1. 程式人生 > 程式設計 >ASP 百度主動推送程式碼範例

ASP 百度主動推送程式碼範例

範例程式碼

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 百度主動推送內容請搜尋我們以前的文章或繼續瀏覽下面的相關文章希望大家以後多多支援我們!