将aspx页面转换成htm页面

简介:

<%
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://www.sina.com.cn"'要读取的页面地址
response.write "开始更新首页..."
wstr = GetPage(Url)

'response.write(wstr)
Set fs=Server.CreateObject("Scripting.FileSystemObject")

'if not MyFile.FolderExists(server.MapPath("/html/")) then 
'MyFile.CreateFolder(server.MapPath("/html/"))'
'end if

'要存放的页面地址
dizhi=server.MapPath("index.htm")
If (fs.FileExists(dizhi)) Then
fs.DeleteFile(dizhi)
End If

Set CrFi=fs.CreateTextFile(dizhi)
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write "...<font color=red>更新完成!</font>"
%>



本文转自tiasys博客园博客,原文链接:http://www.cnblogs.com/tiasys/archive/2006/07/06/444285.html,如需转载请自行联系原作者

相关文章
|
6月前
|
Java
jsp页面中显示word/excel文档方法
jsp页面中显示word/excel文档方法
|
移动开发 编解码 小程序
(H5小程序页面html)页面跳转参数丢失
在 URL 参数字符串中用 key=value 这种键值对的形式进行传递参数,多个键值对中间用 & 连接。如果在 value 中也存在 & 这个符号的话,不对其进行编码,就会引起歧义,就会发生参数丢失问题。
282 0
|
14天前
比较美观的跳转加载页html源码
比较美观的跳转加载页html源码,源码由HTML+CSS+JS组成,记事本打开源码文件可以进行内容文字之类的修改,双击html文件可以本地运行效果
21 0
比较美观的跳转加载页html源码
|
6月前
|
Java
html替换成jsp界面字体图标不显示问题
html替换成jsp界面字体图标不显示问题
25 0
分享个打开a页面自动跳转到b页面的HTML代码
分享个打开a页面自动跳转到b页面的HTML代码
|
Java 开发者
页面静态之生成 html 页面 | 学习笔记
快速学习页面静态之生成 html 页面
jsp页面 上传图片预览 的处理
jsp页面 上传图片预览 的处理
146 0
|
JavaScript 前端开发
使用 JavaScript 的 HTML 页面混合、JavaScript 文件引用和 HTML 代码嵌入 3 种方式在 HTML 页面上打印出“点击我进入到百度首页”的超链接
使用 JavaScript 的 HTML 页面混合、JavaScript 文件引用和 HTML 代码嵌入 3 种方式在 HTML 页面上打印出“点击我进入到百度首页”的超链接
277 0
使用 JavaScript 的 HTML 页面混合、JavaScript 文件引用和 HTML 代码嵌入 3 种方式在 HTML 页面上打印出“点击我进入到百度首页”的超链接
|
.NET Windows 开发框架