当前位置: 首页 > 图文教程 > 网络编程 > ASP > 将指定的asp文件内容生成HTML文件

ASP
亲密接触ASP.Net(16)
NT 下虚拟域名的实现
介绍一种效率极高的分类算法
asp+发送email
用 ASP 技术开发 WEB 调查(投票)系统 (1)
用ASP技术开发 WEB 调查(投票)系统 (2)
用ASP技术开发WEB调查(投票)系统 (3)
ASP+全新接触
ASP+上载例子
从ASP迁移至ASP+--最初的考虑(一)
从ASP迁移至ASP+--进入DataSet
将HTML表格转换为ASP+数据列表(DataList)
急不可耐了?转换其他的页面吧!
用ASP解决域名登记查询
从ASP迁移至ASP+--处理会话变量
从ASP迁移至ASP+--CustomValidator控件
从ASP迁移至ASP+--从用户那儿收集数据
展现C#(1):C#简介
展现C#(2):NGWS Runtime 基础
展现C#(3):第一个C#应用程序

ASP 中的 将指定的asp文件内容生成HTML文件


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 55 ::
收藏到网摘: n/a

 

<%
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.taiang.com.cn/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>"
%>