ASP 百度主動推送代碼范例
范例代碼
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函數(shù)。
調(diào)用方法:
調(diào)用方法:
baiduts=PostHTTPPage(http://data.zz.baidu.com/urls?site=www.dhdzp.com&token=xxxxxxx,http://www.dhdzp.com/article/184256.htm)
到此這篇關(guān)于ASP 百度主動推送代碼范例的文章就介紹到這了,更多相關(guān)ASP 百度主動推送內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Microsoft JET Database Engine(0x80004005)未指定錯誤的解決方法
今天在配置iis asp運行環(huán)境的時候提示Microsoft JET Database Engine(0x80004005)未指定錯誤,不過最后通過如下方法解決了,這里腳本之家小編特為大家分享下,方便需要的朋友2014-06-06
ASP基礎(chǔ)入門第九篇(Global.asa文件的使用)
這篇文章主要介紹了Global.asa文件的使用,是一個可選文件,每個應(yīng)用程序只能有一個 Global.asa 文件,需要了解的朋友可以參考下2015-10-10

