<!--#i nclude virtual="conn.asp"-->/建立数据库连接 <% pagestart=cint(request.querystring("a")) pageend=cint(request.querystring("b")) ssql="select * from database where id>="&pagestart&" and id<="&pageend&"" rst.open ssql,conn,1
GetPage(url) dim Retrieval Set Retrieval = CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "Get", url, False ', "", "" .Send GetPage = BytesToBstr(.ResponseBody) End With Set Retrieval = Nothing End
BytesToBstr(body) 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 = "GB2312" BytesToBstr = objstream.ReadText objstream.Close set objstream = nothing End do while not rst.eof i=rst("id") Url="http://www.***com/***.asp?id="&i&"" '网站数据 wstr = GetPage(Url) Set fs=Server.CreateObject("ing.FileSystemObject") Set yzy=fs.CreateTextFile(server.MapPath("view/view"&i&".html")) yzy.Writeline(wstr) rst.movenext loop rst.close set yzy=nothing set fs=nothing response.Write(i) %>