<% Function BytesToBstr(body) Set fs=Server.CreateObject(“Scripting.FileSystemObject”) if not MyFile.FolderExists(server.MapPath(“/html/”)) then If (fs.FileExists(server.MapPath(“./”)&”\index.htm”)) Then Set CrFi=fs.CreateTextFile(server.MapPath(“./”)&”\index.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
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)
MyFile.CreateFolder(server.MapPath(“/html/”))
end if
fs.DeleteFile(server.MapPath(“./”)&”\index.htm”)
End If
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write “…<font color=red>更新完成!</font>”
%>
将指定的asp文件内容生成html文件_asp技巧
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 将指定的asp文件内容生成html文件_asp技巧
相关推荐
-      ASP基础教程:其它的ASP常用组件
-      ASP基础教程:学习ASP中子程序的应用
-      ASP基础教程之ASP程序对Cookie的处理
-      ASP基础教程之ASP AdRotator组件的使用
-      ADO初学者教程:ADO 通过GetString()加速脚本
-      ASP技巧实例:几行代码解决防止表单重复提交
-      ASP常见数学函数 Abs Atn Cos 等详细详解[ 来源:网页教学网 | 作者: | 时间:2007-09-12 10:57:29 | 收藏本文 ] 【大 中 小】【名称】
-      ASP基础教程之ASP AdRotator 组件的使用