Blogger Information
Blog 7
fans 0
comment 0
visits 5220
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
ASP 百度主动推送代码范例
P粉532570349
Original
718 people have browsed it

百度推送可以让你发布的东西直接推送给百度蜘蛛,让其快速收录,百度官方给出了很多范例知道,但是没有ASP的范例,下面脚本之家网跟大家分享下

范例代码

  1. function BytesToBstr(body,Cset)
  2. dim objstream
  3. set objstream = Server.CreateObject("adodb.stream")
  4. objstream.Type = 1
  5. objstream.Mode =3
  6. objstream.Open
  7. objstream.Write body
  8. objstream.Position = 0
  9. objstream.Type = 2
  10. objstream.Charset = Cset
  11. BytesToBstr = objstream.ReadText
  12. objstream.Close
  13. set objstream = nothing
  14. End function
  15. '==================================================
  16. function PostHTTPPage(url,data)
  17. dim Http
  18. set Http=server.createobject("MSXML2.SERVERXMLHTTP.3.0")
  19. Http.open "POST",url,false
  20. Http.setRequestHeader "CONTENT-TYPE", "text/plain"
  21. Http.send(data)
  22. if Http.readystate<>4 then
  23. exit function
  24. End if
  25. PostHTTPPage=bytesToBSTR(Http.responseBody,"utf-8")
  26. set http=nothing
  27. if err.number<>0 then err.Clear
  28. 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 百度主动推送代码范例的文章就介绍到这了。

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post