Example address:
http://www.18eden.com/rss.asp
Site: http://www.18eden.com/jiankang
The program is placed in the root directory
Or change the address of other directories and yourself to read out the latest 20 resources. (It can be modified to read the get parameter)
Automatically determine the website address and port without manual intervention.
The code copy is as follows:
<%Optionexplicit%>
<!--#includefile="Manage/Include/Config.do"-->
<%
DimsSQL, rs, sCrLf, sXmlClear, sRssHead, sRssEnd, Url
sCrLf=chr(13)&chr(10)'Enter+Win
IfRequest.ServerVariables("HTTPS")="on"Then
URL="https://"
Else
URL="http://"
EndIf
Url=Url&Request.ServerVariables("SERVER_NAME")&":"&Request.ServerVariables("SERVER_PORT")
sXmlClear="<?xmlversion='1.0'encoding='gb2312'?>"&sCrLf
'sRssHead="<rdf:RDFxmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'xmlns:dc='http://purl.org/dc/elements/1.1/'xmlns:sy='http://purl.org/rss/1.0/modules/syndication/'xmlns:admin='http://webns.net/mvcb/'xmlns='http://purl.org/rss/1.0/'>"
sRssHead="<rssversion='2.0'>"&sCrLf
sRssHead=sRssHead&"<channel>"&sCrLf
sRssHead=sRssHead&"<title>"&Def_MySiteTitle&"</title>"&sCrLf
sRssHead=sRssHead&"<description>"&Def_SysTitle&"</description>"&sCrLf
sRssHead=sRssHead&"<link>"&url&"</link>"&sCrLf
sRssHead=sRssHead&"<language>zh-cn</language>"&sCrLf
sRssHead=sRssHead&"<docs>NewsCenter</docs>"&sCrLf
'sRssHead=sRssHead&"<dc:creator>Yezhan,[email protected]</dc:creator>"&sCrLf
sRssHead=sRssHead&"<generator>RssGenerator</generator><items>"&sCrLf
sRssEnd="</items></channel></rss>"
'Response.CharSet="gb2312"' dataset
Response.ContentType="text/xml"'Data flow format definition
Response.ContentType="application/xml"
Response.Expires=0
Response.writesXmlClear
Response.writesRssHead
DimConn
SetConn=Server.CreateObject("Adodb.Connection")
Conn.OpenConnStr
Dimsql