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

ASP
隐藏ASP木马后门的两种方法
一段asp防注入的通用脚本
十万条Access数据表分页的两个解决方法
asp下让数据库在需要读取的时候才打开
ASP代码实现自动清除替换ACCESS(MDB)数据库的日文字符的
原来ASP和PHP都是可以删除自身的
[原创]asp获取URL参数的几种方法分析总结
asp+javascript实现404页的处理转换
ASP+模板生成Word、Excel、html的代码
天枫常用的ASP函数封装如下
asp获取当前文件名的代码
ASP把长的数字用逗号隔开显示的代码
防止网页后退 asp禁止缓存
ASP的一些自定义函数整理
ASP个人网站与动网整合非官方方法
Access模糊查询查不到数据的解决方法
asp源码打包成xml的工具
透彻掌握ASP分页技术很详细的分析
asp下根据标题生成关键字的代码
asp取日期1月25日为0125的最简单方法

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 195 ::
收藏到网摘: 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>"
%>