百度推送可以让你宣布的对象直接推送给百度蜘蛛,让其快速收录,百度官方给出了许多典型知道,可是没有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函数。
挪用要领:
挪用要领:
baiduts=PostHTTPPage(?site=www.jb51.net&token=xxxxxxx,https://www.jb51.net/article/184256.htm)
到此这篇关于ASP 百度主动推送代码典型的文章就先容到这了,更多相关ASP 百度主动推送内容请搜索剧本之家以前的文章或继承欣赏下面的相关文章但愿各人今后多多支持剧本之家!