ASP/Visual Basic代码
- <%
- Set xml = Server.CreateObject("Microsoft.XMLHTTP")
- '易天科技提示您把下面的地址替换成你的首页的文件地址,一定要用http://开头的绝对路径,不能写相对路径哦
- xml.Open "GET", "http://www.yisky.net/yiskyindex.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
- Response.Write ( "易天科技www.yisky.net 提示您,成功生成文件:index.html" )
- '定义BytesToBstr函数
- 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
- %>