通用asp生成html代码--学无止境
来源:百度文库 编辑:神马文学网 时间:2024/04/27 08:39:58
通用asp生成html代码
server 发表于 2006-7-8 15:53:10
代码:
if SaveFile("/new/"&id&".html","http://127.0.0.1/newss.asp?id="&id&"") then 中
/new"&id&".html",是你生成的文件和路径。http://127.0.0.1/news.asp?id="&id&""是asp的路径
大家可以自己设置修改,其中 "&id&" 是读取浏览器的变量。网址改成你自己的。
使用方法,给你的文章列表添加一个连接,如http://127.0.0.1/shengcheng.asp?id=90
90这个变量相信大家会调用吧,这样就能在/new目录下生成按照id排列的html文章了
演示看:http://www.hotlt.com/movie/537.html
程序代码
Dim id
id = Request("id")
%>
<%
if SaveFile("/new/"&id&".html","http://127.0.0.1/news.asp?id="&id&"") then
Response.write "已生成"
else
Response.write "没有生成"
end if
function SaveFile(LocalFileName,RemoteFileUrl)
Dim Ads, Retrieval, GetRemoteData
On Error Resume Next
Set Retrieval = Server.CreateObject("Microso" & "ft.XM" & "LHTTP")
With Retrieval
.Open "Get", RemoteFileUrl, False, "", ""
.Send
GetRemoteData = .ResponseBody
End With
Set Retrieval = Nothing
Set Ads = Server.CreateObject("Ado" & "db.Str" & "eam")
With Ads
.Type = 1
.Open
.Write GetRemoteData
.SaveToFile Server.MapPath(LocalFileName), 2
.Cancel()
.Close()
End With
Set Ads=nothing
if err <> 0 then
SaveFile = false
err.clear
else
SaveFile = true
end if
End function
%>
server 发表于 2006-7-8 15:53:10
代码:
if SaveFile("/new/"&id&".html","http://127.0.0.1/newss.asp?id="&id&"") then 中
/new"&id&".html",是你生成的文件和路径。http://127.0.0.1/news.asp?id="&id&""是asp的路径
大家可以自己设置修改,其中 "&id&" 是读取浏览器的变量。网址改成你自己的。
使用方法,给你的文章列表添加一个连接,如http://127.0.0.1/shengcheng.asp?id=90
90这个变量相信大家会调用吧,这样就能在/new目录下生成按照id排列的html文章了
演示看:http://www.hotlt.com/movie/537.html
程序代码
Dim id
id = Request("id")
%>
<%
if SaveFile("/new/"&id&".html","http://127.0.0.1/news.asp?id="&id&"") then
Response.write "已生成"
else
Response.write "没有生成"
end if
function SaveFile(LocalFileName,RemoteFileUrl)
Dim Ads, Retrieval, GetRemoteData
On Error Resume Next
Set Retrieval = Server.CreateObject("Microso" & "ft.XM" & "LHTTP")
With Retrieval
.Open "Get", RemoteFileUrl, False, "", ""
.Send
GetRemoteData = .ResponseBody
End With
Set Retrieval = Nothing
Set Ads = Server.CreateObject("Ado" & "db.Str" & "eam")
With Ads
.Type = 1
.Open
.Write GetRemoteData
.SaveToFile Server.MapPath(LocalFileName), 2
.Cancel()
.Close()
End With
Set Ads=nothing
if err <> 0 then
SaveFile = false
err.clear
else
SaveFile = true
end if
End function
%>
通用asp生成html代码--学无止境
通用asp生成html代码
通用asp生成html代码
通用asp生成html代码
ASP生成HTML-另一篇
使用ASP生成HTML文件
实例演示:使用ASP生成HTML文件
在ASP中使用FSO组件生成HTML页面
实例演示:使用ASP生成HTML文件 - 商务资源网
ASP.NET生成HTML静态页的一个类
ASP生成静态HTML文件大荟萃【一】
直接生成XML的Google SiteMap代码[ASP版本]
ASP把网页中的电话号码生成图片的代码
ASP把网页中的电话号码生成图片的代码
asp.net(C#) 生成随机验证码的代码
Asp.NET 生成静态页面并分页的代码实现
Asp.NET 生成静态页面并分页的代码00
HTML教程,HTML代码
html代码
动态生成HTML表单
动态生成HTML表单
生成HTML的方法
ASPX网页,添加标签到你意想不到的位置,让生成的html代码正确
不用模板,只用ASP+FSO生成静态HTML页的一个方法(对于内容密集型页面特别适用)