.Net/C#: 利用反射编写通用的 rss 2.0 的 reader__教程 |
|
日期:2007-5-20 1:25:45 人气:137 [大 中 小] |
|
|
|
{ get { return this._managingEditor; } }
public string URL { get { return this._URL; } }
public string DcLanguage { get { return this._dclanguage; } }
//下面私有 Field 的值将 class SimpleRssReader 中通过反射赋值 private string _dclanguage; //dc:language private string _URL; private string _managingEditor; private string _lastBuildDate; private string _title; private string _description; private string _link; private string _language; private string _generator; private string _ttl; private string _copyright; private string _pubDate; private string _category;
} public class RssItem { private RssHeader _Header;
public RssHeader Header { get { return this._Header; } }
//下面私有 Field 的值将 class SimpleRssReader 中通过反射赋值 private string _title; private string _link; private string _description; private string _category; private string _author; private string _pubDate; private string _comments; private string _guid; private string _slashcomments; private string _wfwcomment; private string _wfwcommentRss; private string _trackbackping;
public string TrackbackPing { get { return this._trackbackping; } }
public string WfwCommentRss { get { return this._wfwcommentRss; } }
public string WfwComment { get { return this._wfwcomment; } }
public string SlashComments { get { return this._slashcomments; } } public string Title { get { return this._title; } }
public string Link { get { return this._link; } }
public string Description { get { return this._description; } }
public string Category { get { return this._category; } }
public string Author { get { return this._author; } }
public DateTime PubDate { get { return Util.ParseDateTime(this._pubDate); } }
public string Comments { get { return this._comments; } }
public string Guid { get { return this._guid; } } } public class SimpleRssReader { //RssHeader header 解析处理完毕事件 public delegate void RssHeaderReceiveEventHandler(SimpleRssReader Sender, RssHeader Header); public event RssHeaderReceiveEventHandler RssHeaderReceive;
//某一个 RssItem 解析处理完毕事件 public delegate void RssItemReceiveEventHandler(SimpleRssReader Sender, RssItem Item); public event RssItemReceiveEventHandler RssItemReceive;
private Type _TRS; //typeof(RssHeader) private Type _tri; //typeof(RssItem)
private ArrayList _RssItemsAL;
private RssHeader _rs; public RssHeader RssHeader |
|
出处:本站原创 作者:佚名 |
|
|