你可以用XMLHTTP
<%
Function getHTTPPage(url)
dim objXML
set objXML=server.createobject("MSXML2.XMLHTTP")'定义
objXML.open "GET",url,false'打开
objXML.send()'发送
If objXML.readystate<>4 then '判断文档是否已经解析完,以做客户端接受返回消息
exit function
End If
getHTTPPage=BytesToBstr(objXML.responseBody)'返回信息,同时用函数定义编码
set objXML=nothing'关闭
if err.number<>0 then err.Clear
End Function
Function 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"
'转换原来默认的UTF-8编码转换成GB2312编码,否则直接用XMLHTTP调用有中文字符的网页得到的将是乱码
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Dim Url,Html
Url = "http://www.163.com"'你的网址,如http://Localhost/...必须为网络路径
Html = getHTTPPage(Url)
'写入并生成html文件
Set NewFile=Fso.OpenTextFile(path,2,True)'path为你要保持到的位置,为本地路径
NewFile.Write (Mbcontent)
NewFile.Close
Mbfile.Close
Set NewFile=Nothing
Set Mbfile=Nothing
Set Fso=Nothing