ASP能不能生成HTML
参考代码! 可以实现 生成ASP!!!!
<%
Server.ScriptTimeout=99999999
'on error resume next
Function GetPage(url)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
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"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
SiteURLa=SiteURL&"你要生成的页面"
a = GetPage(SiteURLa)
if err.number<>0 then
response.write "错误页 你自己琢磨吧 都写出来累!"
response.end
end if
Set fso = Server.CreateObject("Scripting.FileSystemObject")
path="union/wenzi1000.htm"
Set fout = fso.CreateTextFile(server.mappath(path))
fout.WriteLine a
fout.close
set fso=nothing
response.flush
response.write SiteURLa&"<br>"
response.write "生成成功!</br>"
%>