| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 561 人关注过本帖
标题:[求助]asp怎么样转换成html页面,代码怎么改?
只看楼主 加入收藏
renqian1320
Rank: 1
等 级:新手上路
帖 子:126
专家分:0
注 册:2005-6-27
收藏
 问题点数:0 回复次数:3 
[求助]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://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>"
%>

比如我现在有个asp页面是http://10.10.10.100/text.asp

我现在想把这个转换成html页?
请问用上面的代码怎么修改?
望高手指点?谢谢了

搜索更多相关主题的帖子: asp html 页面 代码 
2006-06-21 01:47
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
收藏
得分:0 
饭都端到眼前了,连吃都不会?

天津网站建设 http://www./
2006-06-21 09:06
chenxingg
Rank: 1
等 级:新手上路
帖 子:94
专家分:0
注 册:2006-1-5
收藏
得分:0 
很简单的,

替换你的网址就行了

淘服网www.
2006-06-21 18:02
chenxingg
Rank: 1
等 级:新手上路
帖 子:94
专家分:0
注 册:2006-1-5
收藏
得分:0 
如何解决数据变化的问题


换成相对地址就不管用了

[此贴子已经被作者于2006-6-22 8:52:59编辑过]


淘服网www.
2006-06-21 18:08
快速回复:[求助]asp怎么样转换成html页面,代码怎么改?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022107 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved