首页  ·  知识 ·  编程语言
ASP读取RSS
JemBai  http://www.cnblogs.com/JemBai/  ASP  编辑:dezai  图片来源:网络
% @language="VBScript"% %Function readrss(xmlseed)dim xmlDoc dim httpSet http=Server.CreateObject("M

 
<% @language="VBScript"%>

<%
Function readrss(xmlseed)
dim xmlDoc
dim http
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET",xmlseed,False
http.send
Set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.Async=False
xmlDoc.ValidateOnParse=False
xmlDoc.Load(http.ResponseXML)
Set item=xmlDoc.getElementsByTagName("item")
if item.Length<=10 then
%>

<%
else
For i=0 To (item.Length-1)
Set title=item.Item(i).getElementsByTagName("title")
Set link=item.Item(i).getElementsByTagName("link")
Response.Write(""& title.Item(0).Text &"
")
Next
end if
End Function
%>


远程读取XML文件


<%
call readrss("http://www.yangzhi.com/rss.asp")
%>



 

本文作者:JemBai 来源:http://www.cnblogs.com/JemBai/
CIO之家 www.ciozj.com 微信公众号:imciow
    >>频道首页  >>网站首页   纠错  >>投诉
版权声明:CIO之家尊重行业规范,每篇文章都注明有明确的作者和来源;CIO之家的原创文章,请转载时务必注明文章作者和来源;
延伸阅读