asp 动态生成rss(不成生xml文件)代码(2)


</image>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select top 10 * from News order by id desc"
rs.open sql,conn,3,3
do while not rs.eof
Content=rs("Content")
if Len(Contact)>150 then
Content=left(Content,147) & "..."
end if
%>
<item>
<title><%=rs("Title")%></title>
<description><![CDATA[<%=Content%>]]></description>
<link>http://xxrblog.cn/article.asp?id=<%=rs("id")%></link>
<author>作者</author>
<pubDate><%=rs("Time")%></pubDate>
</item>
<%
rs.movenext()
loop
rs.close()
Set rs = Nothing
conn.close
%>
</channel>
</rss>
以上内容经本人测试 能用