当前位置:主页 > 查看内容

ASP 百度主动推送代码范例

发布时间:2021-04-07 00:00| 位朋友查看

简介:范例代码 functionBytesToBstr(body,Cset)dimobjstreamsetobjstream=Server.CreateObject("adodb.stream")objstream.Type=1objstream.Mode=3objstream.Openobjstream.Writebodyobjstream.Position=0objstream.Type=2objstream.Charset=CsetBytesToBstr=objst……

范例代码

function BytesToBstr(body,Cset) 
   dim objstream 
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1 
objstream.Mode =3 
objstream.Open 
objstream.Write body 
objstream.Position = 0 
objstream.Type = 2 
objstream.Charset = Cset 
BytesToBstr = objstream.ReadText 
objstream.Close 
set objstream = nothing 
End function
'==================================================
function PostHTTPPage(url,data) 
dim Http 
set Http=server.createobject("MSXML2.SERVERXMLHTTP.3.0")
Http.open "POST",url,false 
Http.setRequestHeader "CONTENT-TYPE", "text/plain" 
Http.send(data) 
if Http.readystate<>4 then 
exit function 
End if
PostHTTPPage=bytesToBSTR(Http.responseBody,"utf-8") 
set http=nothing 
if err.number<>0 then err.Clear 
End function

ASP百度主动推送需要上面2个ASP函数。

调用方法:

调用方法:

 baiduts=PostHTTPPage(http://data.zz.baidu.com/urls?site=www.jb51.net&token=xxxxxxx,https://www.jb51.net/article/184256.htm)

到此这篇关于ASP 百度主动推送代码范例的文章就介绍到这了,更多相关ASP 百度主动推送内容请搜索尊托云数以前的文章或继续浏览下面的相关文章希望大家以后多多支持尊托云数!


原文链接:https://m.jb51.net/article/184260.htm
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!

推荐图文


随机推荐