如何asp生成html   已解决   悬赏分: 0  
我把它直接改成html后发现网页不能用了 file 引用文件也没了 页面都有错误代码 怎么回事??????
提问者: 徐小明  - 实习 一级     回答数: 1

最佳回答
显然不能直接改,狂晕
直接改了哪里有active sever呢?
<%
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
'把下面的地址替换成你的首页的文件地址,一定要用http://开头的绝对路径,不能写相对路径
xml.Open "GET", "http://www.baidu.com/index.asp", False
xml.Send
BodyText=xml.ResponseBody
BodyText=BytesToBstr(BodyText,"gb2312")
Set xml = Nothing
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile= fso.CreateTextFile(server.MapPath("index.html"), True)
MyFile.WriteLine(BodyText)
MyFile.Close


Function BytesToBstr(body,Cset)
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 = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%>
回答者: 韩寒  - 副董事长 二十五级   回答时间: 2008-11-05 20:08:38
您觉得最佳答案好不好? 目前有 0 个人评价

50%(0)

50%(0)


您尚未登陆, 无法进行对该答案进行评论! 点击这里登陆!