标题: [求助]关于ASP转为静态页面的疑问 [打印本页] 作者: 金马 时间: 2010-1-9 01:34 标题: [求助]关于ASP转为静态页面的疑问 <%
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这个页面,但是页面没有数据