tsys _rss程序
时间:2021-07-01 10:21:17
帮助过:76人阅读
示例地址:
http://www.gxlsystem.com/rss.asp
站点:http://www.gxlsystem.com/jiankang
该程序放根目录
或者其他目录,地址自己改,读出最新的20条资源.( 可以修改成读取get叁数的形式)
自动判断网站地址端口,无需要人工干预.
代码如下:
<% Option explicit %>
<!--#include file="Manage/Include/Config.do" -->
<%
Dim sSQL, rs, sCrLf, sXmlClear, sRssHead, sRssEnd ,Url
sCrLf = chr(13) & chr(10) '回车+换行
If Request.ServerVariables("HTTPS") = "on" Then
URL = "https://"
Else
URL = "http://"
End If
Url=Url&Request.ServerVariables("SERVER_NAME")&":"&Request.ServerVariables("SERVER_PORT")
sXmlClear = "<?xml version='1.0' encoding='gb2312'?>" & sCrLf
'sRssHead ="<rdf:RDF xmlns:rdf='http://www.gxlsystem.com</dc:creator>" & sCrLf
sRssHead = sRssHead & "<generator>Rss Generator</generator><items>" & sCrLf
sRssEnd = "</items></channel></rss>"
'Response.CharSet="gb2312" '数据集
Response.ContentType="text/xml" '数据流格式定义
Response.ContentType="application/xml"
Response.Expires=0
Response.write sXmlClear
Response.write sRssHead
Dim Conn
Set Conn = Server.CreateObject("Adodb.Connection")
Conn.Open ConnStr
Dim sql
Sql="select Top "& RssNewsList_PageSize &" Title,FilePath,AddTime,KeyWord,Content,Classtitle,EditorTitle From view_NewsInfo where Del=0 Order By addTime DESC"
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.open sql,conn,1,2
IF RS.EOF AND RS.BOF Then
Response.Write("<item></item>")
Else
do while not rs.eof
Response.Write("<item>")&RS("Title")
Response.Write("<title><![CDATA["&Rs("Title")&"]]></title>")
Response.Write("<description><![CDATA["&RS("KeyWord")&"]]>")
Response.Write("<content><![CDATA["&RS("Content")&"]]></content>")
Response.Write("<link>" &url&RS("FilePath")&"</link>")
Response.Write("<subject>"&RS("Classtitle")&"</subject>")
Response.Write("<creator>"&RS("EditorTitle")&"</creator>")
Response.Write("<date>"&RS("addtime")&"</date>")
Response.Write("</description></item>")
RS.MoveNext
loop
end if
rs.close
set rs=nothing
Response.write sRssEnd
%>
陆续放出少年不在修改版 tsys修改办法```
http://www.gxlsystem.com/thread-1370996-1-1.html