1
我有一個Feed閱讀器並獲得列表框中的標題,但是如何爲標題插入一個值鏈接?獲取RSS的鏈接
private void Form1_Load(object sender, EventArgs e)
{
var reader = XmlReader.Create("http://feeds.feedburner.com/myusername?format=xml");
var feed = SyndicationFeed.Load<SyndicationFeed>(reader);
foreach (var item in feed.Items)
{
listBox1.Items.Add(item.Title.Text);
listBox1."add value link" = item.Links."Text";
}
}
private void listBox1_Click(object sender, EventArgs e)
{
MessageBox.Show(listBox1."value link for item selected".ToString());
}
如果點擊標題顯示的鏈接
例如:點擊my feed2
顯示wwww/mywebsite/myfeed2
correct:string url = Dictionary [listBox1.SelectedItem.ToString()]; – jolly