|
<%
Function CreateFile(fileName,url)
Dim fs,fname
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set fname =fs.CreateTextFile(FileName,True)
fname.Write GetUrlText(url)
fname.Close
Set fname = Nothing
Set fs = Nothing
End Function
Function GetUrlText(url)
Dim xmlHttp
Set xmlHttp = server.createobject("MSXML2.ServerXMLHTTP")
'xmlHttp.setTimeouts 10000,10000,10000,30000
xmlHttp.Open "GET",url,False
'xmlhttp.setRequestHeader "CONTENT-TYPE", "text/xml"
xmlHttp.Send
If xmlHttp.ReadyState = 4 Then
GetUrlText = xmlHttp.responseText
Else
GetUrlText = ""
End If
End Function
Dim Url
CreateFile Server.MapPath("index.html"),"http://localhost/CeShi/aspnet/index.asp"
response.Redirect "index.html"
%>
把这个贴在index.asp中,可以生成index.html这个页面,但是页面没有数据 |
|