<%Function getHTTPPage(URL) '从网络读取文件
Dim http
Set http = 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
Function BytesToBstr(body, Cset) '从网络读取文件
Dim objstream
Set objstream = 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
sub ASP2HTM(URL,EXname)
HTMLCode=GetHTTPPage(URL)
filename=Exname
if HTMLCode<>"" then
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile(server.mappath(""&filename&""))
fout.write HTMLCode
fout.close
set fout=nothing
set fso=nothing
end if
END sub
%>
Call ASP2HTM(http://www.100tiyan.cn/index.asp,"Default.htm")