打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
通用asp生成html代码

通用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
%>

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
提权时遇到上传cmd.exe缺少对象无法上传的解决办法
xmlhttp组件获取远程文件并筛选出目标数据
HTML代码转换ASP代码
ASP、JSP、PHP 三种技术比较
一个空间多个域名多个网站的办法汇总
什么是 ASP/ASP+/ASP.NET
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服