Sample address:
Http://www.18eden.com/rss.asp
Site: Http://www.18eden.com/jiankang
This program puts the root directory
or other directories, the address of their own change, read out the latest 20 resources. (Can be modified to read the form of get three numbers)
Automatically judge the site address port, no need for manual intervention.
Copy Code code as follows:
<% Option Explicit%>
<!--#include file= "manage/include/config.do"-->
<%
Dim sSQL, RS, Scrlf, Sxmlclear, Srsshead, Srssend, URL
SCRLF = CHR & Chr (10) ' Carriage return + linefeed
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.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 = "<rss version= ' 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>news center</docs>" & Scrlf
' Srsshead = srsshead & <dc:creator>Yezhan,okhtm@msn.com</dc:creator> ' & Scrlf
Srsshead = srsshead & "<generator>rss generator</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.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 as 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
%>
After the release of the juvenile is not modified version Tsys ""
Http://www.im286.com/thread-1370996-1-1.html