无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
<%
Response.ContentType="text/xml"
dim db,dbpath,conn
dim rs,SQL
db="shujuku/hotltcom.mdb"''''这里填写你的数据库地址
Set conn = Server.CreateObject("ADODB.Connection")
dbpath="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open dbpath
%>
<?xml version="1.0" encoding="gb2312"?><rss version="2.0">'这里是xml的版本和语言声明
<channel>
'以下相当于html的meta部分,包括标题.连接.语言.版权信息以及logo图标等
<title>简单的快乐</title>
<link>http://siyizhu.com</link>
<Description>简单的快乐</Description>
<language>zh-cn</language>
<copyright>Copyright 2006 hotlt</copyright>
<webMaster>hotlt@tom.com</webMaster>
<image>
<title>简单的快乐</title>
<url>http://siyizhu.com/logo.gif</url>
<link>http://siyizhu.com/</link><description>siyizhu's weblog</description></image>
'以下是连接数据库数据表部分,top 15代表最新的15条,movie是数据表
<%
SQL="select top 15 * from movie order by id desc"
set rs=conn.execute(SQL)
if rs.Eof or rs.Bof then
response.write "<item></item>"
end if
while not rs.Eof
Title=rs("Title")'这里定义Title是标题,("Title")为字段名称
id=rs("id")'这里定义id是连接id ,("id")为字段名称
Time=rs("Time")'这里定义Time是时间 ,("Time")为字段名称
Content=replace(replace(left(rs("Content"),200),"<","<"),">",">")'这里的Content是内容的字段名称
'以下是rss输出
response.Write "<item>"
Response.write "<title>"&Title&"</title>" '这里是输出标题
response.write "<link>http://siyizhu.com/weblog/article.asp?ID="&id&"</link>" '这里是输出链接,注意要用网址
response.write "<author>siyizhu</author>" '这里是输出作者,如果有字段可以调用字段
response.write "<PubDate>"&Time&"</PubDate>" '这里是时间
response.write "<description><![CDATA["&Content&"]]></description>"'这里是输出简介,因为可能有代码.括起来,否则预览时会提示错误。
response.write "</item>"
rs.MoveNext
wend
set rs=nothing
conn.Close
set conn = nothing
%>
</channel></rss>
注意事项:其中要注意[CDATA*]>的使用,像是内容之类的输出尽量用"[CDATA[ * ]]>",
*为输出内容,应为内容可能为代码形式,如有空格或asp代码.否则可能会出错误.
<%
Response.ContentType="text/xml"
dim db,dbpath,conn
dim rs,SQL
db="shujuku/hotltcom.mdb"''''这里填写你的数据库地址
Set conn = Server.CreateObject("ADODB.Connection")
dbpath="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open dbpath
%>
<?xml version="1.0" encoding="gb2312"?><rss version="2.0">'这里是xml的版本和语言声明
<channel>
'以下相当于html的meta部分,包括标题.连接.语言.版权信息以及logo图标等
<title>简单的快乐</title>
<link>http://siyizhu.com</link>
<Description>简单的快乐</Description>
<language>zh-cn</language>
<copyright>Copyright 2006 hotlt</copyright>
<webMaster>hotlt@tom.com</webMaster>
<image>
<title>简单的快乐</title>
<url>http://siyizhu.com/logo.gif</url>
<link>http://siyizhu.com/</link><description>siyizhu's weblog</description></image>
'以下是连接数据库数据表部分,top 15代表最新的15条,movie是数据表
<%
SQL="select top 15 * from movie order by id desc"
set rs=conn.execute(SQL)
if rs.Eof or rs.Bof then
response.write "<item></item>"
end if
while not rs.Eof
Title=rs("Title")'这里定义Title是标题,("Title")为字段名称
id=rs("id")'这里定义id是连接id ,("id")为字段名称
Time=rs("Time")'这里定义Time是时间 ,("Time")为字段名称
Content=replace(replace(left(rs("Content"),200),"<","<"),">",">")'这里的Content是内容的字段名称
'以下是rss输出
response.Write "<item>"
Response.write "<title>"&Title&"</title>" '这里是输出标题
response.write "<link>http://siyizhu.com/weblog/article.asp?ID="&id&"</link>" '这里是输出链接,注意要用网址
response.write "<author>siyizhu</author>" '这里是输出作者,如果有字段可以调用字段
response.write "<PubDate>"&Time&"</PubDate>" '这里是时间
response.write "<description><![CDATA["&Content&"]]></description>"'这里是输出简介,因为可能有代码.括起来,否则预览时会提示错误。
response.write "</item>"
rs.MoveNext
wend
set rs=nothing
conn.Close
set conn = nothing
%>
</channel></rss>
注意事项:其中要注意[CDATA*]>的使用,像是内容之类的输出尽量用"[CDATA[ * ]]>",
*为输出内容,应为内容可能为代码形式,如有空格或asp代码.否则可能会出错误.
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年09月20日
2024年09月20日
- 魏新雨《为你祈祷+新歌精逊2CD[WAV]
- 影心、明萨拉你选哪个?国外美女COS《博德3》
- 澳洲女子骑车跌入“自杀树”丛 疼痛持续9个月崩溃
- 育碧公布2024“她创力”计划:为女性游戏人提供辅导
- 刘美君.2017-千色·30总选3CD【环球】【WAV+CUE】
- 群星.2022-星河长明电视原声带【乐有奇思】【FLAC分轨】
- 陈淑桦.1995-淑桦盛开Forever【滚石】【WAV+CUE】
- 《再来一张》评测:出师成败皆系“赌”
- 《银河汉堡店》测评:我是银河走菜王!
- 《末日地带2》评测:酣畅淋漓的“和面”之旅
- 萧煌奇《没事的》[320K/MP3][96.22MB]
- 萧煌奇《没事的》[FLAC/分轨][263.38MB]
- 群星《音你而来 第6期》[320K/MP3][90.61MB]
- 交错战线爬塔攻略一览
- 战锤40K星际战士2全近战武器使用教学|近战武器连招表