2
XmlTextWriter xmlRSS = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
Other codes...
List<RssItem> rssContents = new List<RssItem>();
get rssContents data ....
foreach (RssItem item in rssContents)
{
xmlRSS.WriteStartElement("item");
xmlRSS.WriteElementString("title", item.Title);
//How can i add image element here...
xmlRSS.WriteElementString("description", item.Description);
xmlRSS.WriteElementString("link", item.Link);
xmlRSS.WriteElementString("pubDate", item.PublishDate);
xmlRSS.WriteEndElement();
}
xmlRSS.WriteEndElement();
xmlRSS.WriteEndElement();
xmlRSS.WriteEndDocument();
xmlRSS.Flush();
xmlRSS.Close();
Response.End();
我以前試過,但它不工作.. – Sodem 2010-09-27 23:11:04