<% Function CreateStatic(txtURL,FileName) '写入文件 sText = getHTTPPage(txtURL) Set FileObject=Server.CreateObject("Scripting.FileSystemObject") Set openFile=FileObject.OpenTextfile(server.mapPath(Filename),2,true) 'true为不存在自行建立 openFile.writeline(sText) Set OpenFile=nothing End Function 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 getHTTPPage(url) dim Http set Http=server.createobject("MSXML2.XMLHTTP") Http.open "GET",url,false Http.send() if Http.readystate<>4 then exit function end if getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312") set http=nothing if err.number<>0 then err.Clear end function url = request("url") 'response.Write(url) fileName = request("fileName") gotourl = request("gotourl") Call CreateStatic("http://"&url,"/html/ZP/"&fileName & ".html") if gotourl <> "" then response.Write("<mce:script type="text/javascript"><!-- function fun(){location.href='"& gotourl &"'};setTimeout('fun()',3000) // --></mce:script>") response.Write("<br/><br/><table align=center><tr><td>操作成功,3秒后自动跳转...</td></tr></table>") response.End() end if %>