예제 주소 :
http://www.18eden.com/rss.asp
사이트 : http://www.18eden.com/jiankang
이 프로그램은 루트 디렉토리에 배치됩니다
또는 다른 디렉토리와 자신의 주소를 변경하여 최신 20 개의 리소스를 읽으십시오. (GET 매개 변수를 읽도록 수정할 수 있습니다)
수동 개입없이 웹 사이트 주소와 포트를 자동으로 결정합니다.
코드 사본은 다음과 같습니다.
<%옵션 출현%>
<!-#includefile = "관리/include/config.do"->
<%
DimsSql, Rs, Scrlf, SxmlClear, SrsShead, SrsSend, URL
scrlf = chr (13) & chr (10) '입력+승리
ifrequest.servariables ( "https") = "on"그런 다음
url = "https : //"
또 다른
url = "http : //"
endif
url = url & request.servervariables ( "server_name") & ":"& request.servervaribles ( "server_port")
sxmlclear = "<? xmlversion = '1.0'encoding ='gb2312 '?>"& scrlf
'srsshead = "<rdf : rdfxmlns : rdf ='http : //www.w3.org/1999/02/22-rdf-syntax-ns#'xmlns : 'http : //purl.org/dc/elements/1/'xmln s : 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 & "<cression>"& def_systitle & "</description>"& scrlf
srsshead = srsshead & "<link>"& url & "</link>"& scrlf
srsshead = srsshead & "<language> zh-cn </language>"& scrlf
srsshead = srsshead & "<ocs> newscenter </docs>"& scrlf
'srsshead = srsshead & "<dc : creator> yezhan, [email protected] </dc : creator>"& scrlf
srsshead = srsshead & "<generator> rssgenerator </generator> <items>"& scrlf
srssend = "</items> </채널> </rss>"
'response.charset = "gb2312"'데이터 세트
응답 .ContentType = "Text/XML" '데이터 흐름 형식 정의
응답 .ContentType = "Application/XML"
응답 .expires = 0
response.writesxmlClear
응답 .WritesrsShead
디콘
setconn = server.createobject ( "adodb.connection")
conn.openconnstr
dimsql