将指定的asp文件内容生成HTML文件
来源:互联网 发布:js同源策略是什么 编辑:程序博客网 时间:2024/04/29 13:52
将指定的asp文件内容生成HTML文件
<%
Function GetPage(url)
dim Retrieval
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
on error resume next
Url="http://###########/index.asp"
response.write "开始更新首页..."
wstr = GetPage(Url)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
'if not MyFile.FolderExists(server.MapPath("/html/")) then
'MyFile.CreateFolder(server.MapPath("/html/"))'
'end if
If (fs.FileExists(server.MapPath("./")&"/index.htm")) Then
fs.DeleteFile(server.MapPath("./")&"/index.htm")
End If
Set CrFi=fs.CreateTextFile(server.MapPath("./")&"/index.htm")
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write "...<font color=red>更新完成!</font>"
%>
Function GetPage(url)
dim Retrieval
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
on error resume next
Url="http://###########/index.asp"
response.write "开始更新首页..."
wstr = GetPage(Url)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
'if not MyFile.FolderExists(server.MapPath("/html/")) then
'MyFile.CreateFolder(server.MapPath("/html/"))'
'end if
If (fs.FileExists(server.MapPath("./")&"/index.htm")) Then
fs.DeleteFile(server.MapPath("./")&"/index.htm")
End If
Set CrFi=fs.CreateTextFile(server.MapPath("./")&"/index.htm")
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write "...<font color=red>更新完成!</font>"
%>
- 将指定的asp文件内容生成HTML文件
- 将指定的asp文件内容生成HTML文件
- 将指定的asp文件内容生成HTML文件
- 将指定的asp文件内容生成HTML文件
- 将指定的asp文件内容生成HTML文件
- 将指定的asp文件内容生成HTML文件
- 用js 将 HTML 的 内容生成 xml 文件
- ASP生成指定格式的EXCEl文件
- doc命令,将生成的内容保存到指定文件中
- 使用Python将TXT文本内容读取后生成指定XML格式的文件
- 将指定文件内容转化为指定编码的字符串
- ASP.NET生成HTML文件的方法
- asp自动生成html文件的方法
- asp自动生成html文件的方法
- 使用ASP生成HTML文件
- 使用ASP生成HTML文件
- asp生成html文件代码
- 使用ASP生成HTML文件
- MASM-两个16位二进制数减法模拟
- 工作流
- MASM-打字练习程序
- 在遥远的邮件找到密码
- MASM-文件记录操作
- 将指定的asp文件内容生成HTML文件
- 几首好听的歌曲-来自99music.net
- 关于tomcat服务器无法启动一解决办法
- 钓鱼
- 善待自己,善待生命!!
- 在不同分辨率下调整程序窗口
- 一篇讲autoconf/automake的好文章
- Visual C++ 2005 中的XML注释
- SQL SERVER实用经验技巧集