范例代码
functionBytesToBstr(body,Cset)
dimobjstream
setobjstream=Server.CreateObject(\”adodb.stream\”)
objstream.Type=1
objstream.Mode=3
objstream.Open
objstream.Writebody
objstream.Position=0
objstream.Type=2
objstream.Charset=Cset
BytesToBstr=objstream.ReadText
objstream.Close
setobjstream=nothing
Endfunction
\’==================================================
functionPostHTTPPage(url,data)
dimHttp
setHttp=server.createobject(\”MSXML2.SERVERXMLHTTP.3.0\”)
Http.open\”POST\”,url,false
Http.setRequestHeader\”CONTENT-TYPE\”,\”text/plain\”
Http.send(data)
ifHttp.readystate<>4then
exitfunction
Endif
PostHTTPPage=bytesToBSTR(Http.responseBody,\”utf-8\”)
sethttp=nothing
iferr.number<>0thenerr.Clear
Endfunction
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 百度主动推送内容请搜索悠久资源网以前的文章或继续浏览下面的相关文章希望大家以后多多支持悠久资源网!