ASP.NET伏撹RSS Feed
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-05-21
const string XMLNS_DC = "http://purl.org/dc/elements/1.1/"; 154 private const string LINK = "http://www.MyWii.com.au/"; 155 private const string DESCRIPTION = "description"; 156 private const string LANGUAGE = "en-us"; 157 private const string COPYRIGHT = "Copyright 2006"; 158 private const string GENERATOR = "MyMedia RSS Generator"; 159 private const string IMAGE_URL = "http://www.MyWii.com.au/img/main/feed.gif"; 160 private const string IMAGE_TITLE = "MyWii"; 161 private const string IMAGE_LINK = "http://www.MyWii.com.au"; 162 private string PUB_DATE = DateTime.Now.ToString("r"); 163 private string LAST_BUILD_DATE = DateTime.Now.ToString("r"); 164 165 #endregion 166 167 Internal member variables#region Internal member variables 168 private XmlTextWriter rssWriter; 169 private bool hasMedia; 170 private IList<ItemInfo> items; 171 #endregion 172 173 Properties#region Properties 174 public XmlTextWriter RssWriter 175 { 176 set { rssWriter = value; } 177 get { return rssWriter; } 178 } 179 public bool HasMedia 180 { 181 set { hasMedia = value; } 182 get { return hasMedia; } 183 } 184 public IList<ItemInfo> Items 185 { 186 set { items = value; } 187 get { return items; } 188 } 189 190 #endregion 191 192 Private method#region Private method 193 194 private void WritePrologue() 195 { 196 rssWriter.WriteStartDocument(); 197 rssWriter.WriteStartElement("rss"); 198 rssWriter.WriteAttributeString("version", "2.0"); 199 rssWriter.WriteAttributeString("xmlns:media", XMLNS_MEDIA); 200 rssWriter.WriteAttributeString("xmlns:dc", XMLNS_DC); 201 rssWriter.WriteString("n "); 202 // Write in channel block 203 rssWriter.WriteStartElement("channel"); 204 rssWriter.WriteString("n "); 205 rssWriter.WriteElementString("title", TITLE); 206 rssWriter.WriteString("n "); 207 rssWriter.WriteElementString("link", LINK); 208 rssWriter.WriteString("n "); 209 rssWriter.WriteElementString("description", DESCRIPTION); 210 rssWriter.WriteString("n "); 211 rssWriter.WriteElementString("pubDate", PUB_DATE); 212 rssWriter.WriteString("n "); 213 rssWriter.WriteElementString("lastBuildDate", LAST_BUILD_DATE); 214 rssWriter.WriteString("n "); 215 rssWriter.WriteElementString(&q |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: asp.net关于文件在数据库的存入和读取下一篇: 使用ASP.Net中的自定义控件
关于ASP.NET伏撹RSS Feed的所有评论