欢迎光临“石家庄浩析网络科技有限公司”网站!
【沧州】切换分站
销售部电话:13292823610

全国服务热线13292823610

1 2
在本公司做网站免费技术维护一年,送COM域名、5G高速空间! 自主开发程序、非模板站,速度快、安全防被黑,欢迎咨询!

沧州做网站知识 当前位置:首页 >> 做网站知识

沧州ASP百度推送代码

2022-12-27 本文被阅读 68062 次

现在用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



使用的话就是:

baiduts=PostHTTPPage("http://data.zz.baidu.com/urls?site=www.sjzzwz.cn&token=xxxxxxx,https://www.sjzzwz.cn/zhishi/61.html")


猜你喜欢

Copyright © 2023 石家庄浩析网络科技有限公司 沧州做网站就找浩析网络!  冀ICP备2023040404号-1  XML地图