あくまでサンプルコードです。オブジェクト関連は入ってないので、そのあたりはなにか適当なの割り当ててください。
あと、RSSの解析にはRSS用のものでなく、汎用のXMLライブラリを使っています。NHKニュースのRSSデータを使わせてもらいました。
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Xml; using System.Windows.Forms; namespace getnews { public partial class Form1 : Form { public Form1() { InitializeComponent(); // textBox1.Text = "(RSSのURL)"; // for TEST getReady(true); } // // コード変換 // private string cnvTextCode(string from, System.Text.Encoding to) { byte[] src_temp = System.Text.Encoding.ASCII.GetBytes(from); byte[] dest_temp = System.Text.Encoding.Convert(System.Text.Encoding.ASCII, to, src_temp); string r = to.GetString(dest_temp); return (r); } // // Ready to Go // private void getReady(bool tf) { if (tf == true) { button1.Text = "アクセス可能"; button1.Enabled = true; } else { button1.Text = "お待ちください"; button1.Enabled = false; } } // // 指定エレメントの中身を表示する。 // private string getElementByTagName(XmlNode n, string name) { string r = null; foreach (XmlNode no in n.ChildNodes) { if (name.CompareTo(no.Name) == 0) { r = no.InnerText; break; } } return(r); } // // 日付文字列をパースしてオブジェクトで返す。 // private DateTime asc2Date(string q) { DateTime dt = new DateTime(); dt = DateTime.Parse(q); return (dt); } private void b1click(object sender, EventArgs e) { //string outputHtml = @"C:\tmp\yahoo.html"; //StreamWriter writer = new StreamWriter(outputHtml); WebClient client = new WebClient(); string web = textBox1.Text; if (Regex.IsMatch(web, @"^http://", RegexOptions.IgnoreCase)) { //string str = client.DownloadString(web); getReady(false); byte[] d = client.DownloadData(web); Encoding en = Encoding.UTF8; string str = en.GetString(d); // textBox2.Text = str; listBox1.Items.Clear(); // XmlDocument doc = new XmlDocument(); using(StringReader rr = new StringReader(str)){ doc.Load(rr); XmlNodeList nodeList; XmlNode root = doc.DocumentElement; // 行選択 nodeList = root.SelectNodes("channel/item"); foreach (XmlNode nd in nodeList) { string title = getElementByTagName(nd, "title"); string url = getElementByTagName(nd, "link"); string desc = getElementByTagName(nd, "description"); string date = getElementByTagName(nd, "pubDate"); if (date == null) // 日付が取れてない。 { date = getElementByTagName(nd, "date"); if (date == null) { // やはり無理のようだ。 date = "1990/07/18 12:00:00"; } } DateTime dt = asc2Date(date); string dat = dt.ToString("MM/dd/yyyy HH:mm") + ":" + title + ":" + url; listBox1.Items.Add(dat); string[] item = { dt.ToString("MM/dd/yyyy HH:mm"), title, url }; listView1.Items.Add(new ListViewItem(item)); } // // } //textBox2.Text = str; getReady(true); } else { MessageBox.Show("http:// から始まるURLになっていますか?"); } } } }