Home > php教程 > php手册 > body text

读取RSS文件

WBOY
Release: 2016-06-06 20:01:32
Original
1042 people have browsed it

//读取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中的内容

 

            

                

                    

            

 

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!