Home  >  Article  >  php教程  >  读取RSS文件

读取RSS文件

WBOY
WBOYOriginal
2016-06-06 20:01:321043browse

//读取RSS文件 using System.Net; using System.IO; WebClient client = new WebClient(); using (Stream rss = client.OpenRead("http://forum.com-edu.cn/tools/rss.aspx")) { DataSet ds = new DataSet(); ds.ReadXml(rss); Repeater1.DataSource = ds.Ta

 

//读取RSS文件

 

using System.Net;

using System.IO;

 

        WebClient client = new WebClient();

        using (Stream rss = client.OpenRead("http://forum.com-edu.cn/tools/rss.aspx"))

        {

            DataSet ds = new DataSet();

            ds.ReadXml(rss);

            Repeater1.DataSource = ds.Tables[2].DefaultView;

            Repeater1.DataBind();

        }

 

//用这种方式生成三张表

第一张表:RSS版本号

第二张表:RSS信息内容

第三张表:存放item中的内容

 

            

                

                    

            

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn