880 lines
23 KiB
C#
880 lines
23 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Reflection;
|
|||
|
|
using System.Xml;
|
|||
|
|
using CYQ.Data.Table;
|
|||
|
|
using CYQ.Data.Tool;
|
|||
|
|
namespace CYQ.Data.Xml
|
|||
|
|
{
|
|||
|
|
//public class RssDemo
|
|||
|
|
//{
|
|||
|
|
// public string GetRss()
|
|||
|
|
// {
|
|||
|
|
// Rss2 rss = new Rss2();
|
|||
|
|
// rss.channel.Title = "<22><>ɫ";
|
|||
|
|
// rss.channel.Link = "http://www.cyqdata.com";
|
|||
|
|
// rss.channel.Description = "<22><>ɫ-QBlog-Power by Blog.CYQ";
|
|||
|
|
// for (int i = 0; i < 10; i++)
|
|||
|
|
// {
|
|||
|
|
// RssItem item = new RssItem();
|
|||
|
|
// item.Title = string.Format("<22><>{0}<7D><>", i);
|
|||
|
|
// item.Link = "http://www.cyqdata.com";
|
|||
|
|
// item.Description = "<22>ܳ<EFBFBD><DCB3>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
|
// rss.channel.Items.Add(item);
|
|||
|
|
// }
|
|||
|
|
// return rss.OutXml;
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
//public class Rss2
|
|||
|
|
//{
|
|||
|
|
// XmlDocument rssDoc;
|
|||
|
|
// public RssChannel channel;
|
|||
|
|
// public Rss2()
|
|||
|
|
// {
|
|||
|
|
// rssDoc = new XmlDocument();
|
|||
|
|
// rssDoc.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?><rss version=\"2.0\"><channel></channel></rss>");
|
|||
|
|
// channel = new RssChannel();
|
|||
|
|
// }
|
|||
|
|
// private void BuildRss()
|
|||
|
|
// {
|
|||
|
|
// XmlNode cNode = rssDoc.DocumentElement.ChildNodes[0];//ȡ<><C8A1>channelԪ<6C><D4AA>
|
|||
|
|
// ForeachCreateChild(cNode, channel);//Channel<65><6C><EFBFBD><EFBFBD>
|
|||
|
|
// if (channel.RssImage != null)
|
|||
|
|
// {
|
|||
|
|
// ForeachCreateChild(Create("image", null, cNode), channel.RssImage);//Channel-Image<67><65><EFBFBD><EFBFBD>
|
|||
|
|
// }
|
|||
|
|
// if (channel.Items.Count > 0)
|
|||
|
|
// {
|
|||
|
|
// foreach (RssItem item in channel.Items)
|
|||
|
|
// {
|
|||
|
|
// ForeachCreateChild(Create("item", null, cNode), item);//Channel-Items<6D><73><EFBFBD><EFBFBD>
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// private void ForeachCreateChild(XmlNode parent, object obj)
|
|||
|
|
// {
|
|||
|
|
// object propValue = null;
|
|||
|
|
// PropertyInfo[] pis = obj.GetType().GetProperties();
|
|||
|
|
// for (int i = 0; i < pis.Length; i++)
|
|||
|
|
// {
|
|||
|
|
// if (pis[i].Name == "Items" || pis[i].Name == "Image")
|
|||
|
|
// {
|
|||
|
|
// continue;
|
|||
|
|
// }
|
|||
|
|
// propValue = pis[i].GetValue(obj, null);
|
|||
|
|
// if (propValue == null || propValue == DBNull.Value)
|
|||
|
|
// {
|
|||
|
|
// continue;
|
|||
|
|
// }
|
|||
|
|
// if (pis[i].Name == "Description")
|
|||
|
|
// {
|
|||
|
|
// propValue = "<![CDATA[" + propValue.ToString() + "]]>";
|
|||
|
|
// }
|
|||
|
|
// Create(pis[i].Name.Substring(0, 1).ToLower() + pis[i].Name.Substring(1), propValue.ToString(), parent);
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// private XmlNode Create(string name, string value,XmlNode parent)
|
|||
|
|
// {
|
|||
|
|
// XmlElement xNode = rssDoc.CreateElement(name);
|
|||
|
|
// if (string.IsNullOrEmpty(value))
|
|||
|
|
// {
|
|||
|
|
// xNode.InnerXml = value;
|
|||
|
|
// }
|
|||
|
|
// parent.AppendChild(xNode as XmlNode);
|
|||
|
|
// return xNode as XmlNode;
|
|||
|
|
// }
|
|||
|
|
// public string OutXml
|
|||
|
|
// {
|
|||
|
|
// get
|
|||
|
|
// {
|
|||
|
|
// BuildRss();
|
|||
|
|
// return rssDoc.OuterXml;
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Rss<73><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public class Rss
|
|||
|
|
{
|
|||
|
|
internal class RssItemMap
|
|||
|
|
{
|
|||
|
|
internal string RssItemName;
|
|||
|
|
internal object[] TableColumnNames;
|
|||
|
|
internal string FormatText;
|
|||
|
|
}
|
|||
|
|
MDataTable _MTable = null;
|
|||
|
|
List<RssItemMap> mapList = new List<RssItemMap>();//<2F><>MDataTableӳ<65><D3B3>
|
|||
|
|
private RssChannel channel;
|
|||
|
|
/// <summary>
|
|||
|
|
/// RSS Ƶ<><C6B5><EFBFBD><EFBFBD>Ĭ<EFBFBD>ϣ<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public RssChannel Channel
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return channel;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
RssImage img;
|
|||
|
|
XHtmlAction rssDoc;
|
|||
|
|
public Rss()
|
|||
|
|
{
|
|||
|
|
rssDoc = new XHtmlAction(false);
|
|||
|
|
//rssDoc.ReadOnly = true;
|
|||
|
|
rssDoc.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?><rss version=\"2.0\"><channel></channel></rss>");
|
|||
|
|
channel = new RssChannel();
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="title"><3E><>վ<EFBFBD><D5BE><EFBFBD><EFBFBD></param>
|
|||
|
|
/// <param name="link"><3E><>ַ</param>
|
|||
|
|
/// <param name="description"><3E><>վ<EFBFBD><D5BE><EFBFBD><EFBFBD></param>
|
|||
|
|
public void Set(string title, string link, string description)
|
|||
|
|
{
|
|||
|
|
channel.Title = title;
|
|||
|
|
channel.Link = link;
|
|||
|
|
channel.Description = description;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>վLogo<67><6F>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="url">Logo<67><6F>ַ</param>
|
|||
|
|
/// <param name="title">Logo<67><6F><EFBFBD><EFBFBD></param>
|
|||
|
|
/// <param name="link">Logo<67><6F><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ת<EFBFBD><D7AA><EFBFBD><EFBFBD></param>
|
|||
|
|
public void SetImg(string url, string title, string link)
|
|||
|
|
{
|
|||
|
|
if (img == null)
|
|||
|
|
{
|
|||
|
|
img = new RssImage();
|
|||
|
|
img.Url = url;
|
|||
|
|
img.Title = title;
|
|||
|
|
img.Link = link;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>RSS<53><EFBFBD><EEA3A8><EFBFBD>£<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="title"><3E><><EFBFBD><EFBFBD></param>
|
|||
|
|
/// <param name="link"><3E><><EFBFBD><EFBFBD></param>
|
|||
|
|
/// <param name="author"><3E><><EFBFBD><EFBFBD></param>
|
|||
|
|
/// <param name="pubDate"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
|
/// <param name="description"><3E><><EFBFBD>ݻ<EFBFBD>ժҪ</param>
|
|||
|
|
public void AddItem(string title, string link, string author, string pubDate, string description)
|
|||
|
|
{
|
|||
|
|
RssItem item = new RssItem();
|
|||
|
|
item.Title = title;
|
|||
|
|
item.Link = link;
|
|||
|
|
item.Author = author;
|
|||
|
|
item.PubDate = pubDate;
|
|||
|
|
item.Description = description;
|
|||
|
|
channel.Items.Add(item);
|
|||
|
|
}
|
|||
|
|
public delegate string SetForeachEventHandler(string text, MDictionary<string, string> values, int rowIndex);
|
|||
|
|
/// <summary>
|
|||
|
|
///LoadData<74><61>MDataTable<6C><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD>ʽ<EFBFBD><CABD>ÿһ<C3BF><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public event SetForeachEventHandler OnForeach;
|
|||
|
|
private void BuildRss()
|
|||
|
|
{
|
|||
|
|
object propValue = null;
|
|||
|
|
|
|||
|
|
XmlNode cNode = rssDoc.XmlDoc.DocumentElement.ChildNodes[0];
|
|||
|
|
CreateNode(cNode, channel);//Channel<65><6C><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
XmlNode iNode = null;
|
|||
|
|
if (img != null)
|
|||
|
|
{
|
|||
|
|
iNode = rssDoc.CreateNode("image", string.Empty);
|
|||
|
|
cNode.AppendChild(iNode);
|
|||
|
|
CreateNode(iNode, img);//Channel-Image<67><65><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
if (channel.Items.Count > 0)
|
|||
|
|
{
|
|||
|
|
foreach (RssItem item in channel.Items)
|
|||
|
|
{
|
|||
|
|
iNode = rssDoc.CreateNode("item", string.Empty);
|
|||
|
|
cNode.AppendChild(iNode);
|
|||
|
|
CreateNode(iNode, item);//Channel-Items<6D><73><EFBFBD><EFBFBD>
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (_MTable != null && mapList.Count > 0)
|
|||
|
|
{
|
|||
|
|
foreach (MDataRow row in _MTable.Rows)
|
|||
|
|
{
|
|||
|
|
iNode = rssDoc.CreateNode("item", string.Empty);
|
|||
|
|
cNode.AppendChild(iNode);
|
|||
|
|
//foreach (RssItemMap item in mapList)
|
|||
|
|
RssItemMap item = null;
|
|||
|
|
for (int k = 0; k < mapList.Count; k++)
|
|||
|
|
{
|
|||
|
|
item = mapList[k];
|
|||
|
|
if (item.TableColumnNames.Length > 0)
|
|||
|
|
{
|
|||
|
|
MDictionary<string, string> dic = new MDictionary<string, string>(item.TableColumnNames.Length, StringComparer.OrdinalIgnoreCase);
|
|||
|
|
object[] values = new object[item.TableColumnNames.Length];
|
|||
|
|
for (int i = 0; i < item.TableColumnNames.Length; i++)
|
|||
|
|
{
|
|||
|
|
string columnName = item.TableColumnNames[i].ToString();
|
|||
|
|
values[i] = row[columnName].Value;
|
|||
|
|
dic.Set(columnName, Convert.ToString(values[i]));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
if (OnForeach != null)
|
|||
|
|
{
|
|||
|
|
item.FormatText = OnForeach(item.FormatText, dic, k);
|
|||
|
|
}
|
|||
|
|
if (string.IsNullOrEmpty(item.FormatText))
|
|||
|
|
{
|
|||
|
|
propValue = values[0];
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
propValue = string.Format(item.FormatText, values);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//else if (item.TableColumnNames.Length > 0)
|
|||
|
|
//{
|
|||
|
|
// propValue = row[item.TableColumnNames[0].ToString()].Value;
|
|||
|
|
// if (!string.IsNullOrEmpty(item.FormatText))
|
|||
|
|
// {
|
|||
|
|
// propValue = string.Format(item.FormatText, propValue);
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
propValue = item.FormatText;
|
|||
|
|
}
|
|||
|
|
if (propValue == null || propValue == DBNull.Value)
|
|||
|
|
{
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
if (item.RssItemName == "Description")
|
|||
|
|
{
|
|||
|
|
propValue = rssDoc.SetCDATA(propValue.ToString());
|
|||
|
|
}
|
|||
|
|
rssDoc.CreateNodeTo(iNode, item.RssItemName.Substring(0, 1).ToLower() + item.RssItemName.Substring(1), propValue.ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private void CreateNode(XmlNode parent, object obj)
|
|||
|
|
{
|
|||
|
|
object propValue = null;
|
|||
|
|
List<PropertyInfo> pis = Tool.ReflectTool.GetPropertyList(obj.GetType());
|
|||
|
|
for (int i = 0; i < pis.Count; i++)
|
|||
|
|
{
|
|||
|
|
if (pis[i].Name == "Items")
|
|||
|
|
{
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
propValue = pis[i].GetValue(obj, null);
|
|||
|
|
if (propValue == null || propValue == DBNull.Value)
|
|||
|
|
{
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
if (pis[i].Name == "Description")
|
|||
|
|
{
|
|||
|
|
propValue = rssDoc.SetCDATA(propValue.ToString());
|
|||
|
|
}
|
|||
|
|
parent.AppendChild(rssDoc.CreateNode(pis[i].Name.Substring(0, 1).ToLower() + pis[i].Name.Substring(1), propValue.ToString()));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RSS<53><53><EFBFBD>ݡ<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string OutXml
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
BuildRss();
|
|||
|
|
return rssDoc.XmlDoc.OuterXml;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#region <EFBFBD><EFBFBD>MDataTable<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>MDataTable,֮<><D6AE><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD>SetMap<61><70><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>ӳ<EFBFBD><D3B3>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="table"></param>
|
|||
|
|
public void LoadData(MDataTable table)
|
|||
|
|
{
|
|||
|
|
_MTable = table;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>MDataTable<6C><65><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>ӳ<EFBFBD><D3B3>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="itemName">Rss<73><73><EFBFBD><EFBFBD></param>
|
|||
|
|
/// <param name="formatText"><3E><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>硰{0}.Name<6D><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ֱ<EFBFBD>Ӹ<EFBFBD>Nullֵ</param>
|
|||
|
|
/// <param name="tableColumnNames">ͬDataTable<6C><65><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD></param>
|
|||
|
|
public void SetMap(RssItemName itemName, string formatText, params object[] tableColumnNames)
|
|||
|
|
{
|
|||
|
|
RssItemMap map = new RssItemMap();
|
|||
|
|
map.RssItemName = itemName.ToString();
|
|||
|
|
map.FormatText = formatText;
|
|||
|
|
map.TableColumnNames = tableColumnNames;
|
|||
|
|
mapList.Add(map);
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// RSS Ƶ<><C6B5>
|
|||
|
|
/// </summary>
|
|||
|
|
public class RssChannel
|
|||
|
|
{
|
|||
|
|
#region <EFBFBD><EFBFBD>ѡ
|
|||
|
|
private string _Title;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Title
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Title;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Title = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Link;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>Ƶ<EFBFBD><C6B5><EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Link
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Link;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Link = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Description;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Description
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Description;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Description = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region <EFBFBD><EFBFBD>ѡ
|
|||
|
|
private string _Category;
|
|||
|
|
/// <summary>
|
|||
|
|
/// Ϊ feed <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Category
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Category;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Category = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Cloud;
|
|||
|
|
/// <summary>
|
|||
|
|
/// ע<><D7A2><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD><CCA3>Ի<EFBFBD><D4BB><EFBFBD> feed <20><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>֪ͨ
|
|||
|
|
/// </summary>
|
|||
|
|
public string Cloud
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Cloud;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Cloud = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Copyright;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>֪<EFBFBD><D6AA>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Copyright
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Copyright;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Copyright = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Docs;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>涨ָ<E6B6A8><D6B8><EFBFBD><EFBFBD>ǰ RSS <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ø<EFBFBD>ʽ˵<CABD><CBB5><EFBFBD><EFBFBD> URL
|
|||
|
|
/// </summary>
|
|||
|
|
public string Docs
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Docs;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Docs = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Generator;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>涨ָ<E6B6A8><D6B8><EFBFBD><EFBFBD>ǰ RSS <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ø<EFBFBD>ʽ˵<CABD><CBB5><EFBFBD><EFBFBD> URL
|
|||
|
|
/// </summary>
|
|||
|
|
public string Generator
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Generator;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Generator = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Language = "zh-cn";
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>涨<EFBFBD><E6B6A8>д feed <20><><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Language
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Language;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Language = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private string _LastBuildDate;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD> feed <20><><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string LastBuildDate
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _LastBuildDate;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_LastBuildDate = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _ManagingEditor;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD> feed <20><><EFBFBD>ݱ༭<DDB1>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ַ
|
|||
|
|
/// </summary>
|
|||
|
|
public string ManagingEditor
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _ManagingEditor;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_ManagingEditor = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _PubDate;
|
|||
|
|
/// <summary>
|
|||
|
|
/// Ϊ feed <20><><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3B7A2B2><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string PubDate
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _PubDate;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_PubDate = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Rating;
|
|||
|
|
/// <summary>
|
|||
|
|
/// feed <20><> PICS <20><><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Rating
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Rating;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Rating = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _SkipDays;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>涨<EFBFBD><E6B6A8><EFBFBD><EFBFBD> feed <20><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string SkipDays
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _SkipDays;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_SkipDays = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _SkipHours;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>涨<EFBFBD><E6B6A8><EFBFBD><EFBFBD> feed <20><><EFBFBD>µ<EFBFBD>Сʱ
|
|||
|
|
/// </summary>
|
|||
|
|
public string SkipHours
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _SkipHours;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_SkipHours = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _TextInput;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>涨Ӧ<E6B6A8><D3A6><EFBFBD><EFBFBD> feed һͬ<D2BB><CDAC>ʾ<EFBFBD><CABE><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string TextInput
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _TextInput;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_TextInput = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Ttl;
|
|||
|
|
/// <summary>
|
|||
|
|
/// ָ<><D6B8><EFBFBD><EFBFBD> feed Դ<><D4B4><EFBFBD>´<EFBFBD> feed ֮ǰ<D6AE><C7B0>feed <20>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Ttl
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Ttl;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Ttl = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _WebMaster;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> feed <20><> web <20><><EFBFBD><EFBFBD>Ա<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ַ
|
|||
|
|
/// </summary>
|
|||
|
|
public string WebMaster
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _WebMaster;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_WebMaster = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _RssImage;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> feed <20><> ͼƬLogo
|
|||
|
|
/// </summary>
|
|||
|
|
public string RssImage
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _RssImage;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_RssImage = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
private List<RssItem> _Items = new List<RssItem>();
|
|||
|
|
/// <summary>
|
|||
|
|
/// Ƶ<><C6B5><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public List<RssItem> Items
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Items;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Items = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// ͼƬ<CDBC><C6AC>
|
|||
|
|
/// </summary>
|
|||
|
|
public class RssImage
|
|||
|
|
{
|
|||
|
|
#region <EFBFBD><EFBFBD>ѡ
|
|||
|
|
private string _Url;
|
|||
|
|
/// <summary>
|
|||
|
|
/// ͼƬ<CDBC><C6AC>ַ
|
|||
|
|
/// </summary>
|
|||
|
|
public string Url
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Url;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Url = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Title;
|
|||
|
|
/// <summary>
|
|||
|
|
/// ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Title
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Title;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Title = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Link;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>ṩͼƬ<CDBC><C6AC>վ<EFBFBD><D5BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Link
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Link;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Link = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Description;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Description
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Description;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Description = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// RSS<53><53>
|
|||
|
|
/// </summary>
|
|||
|
|
public class RssItem
|
|||
|
|
{
|
|||
|
|
#region <EFBFBD><EFBFBD>ѡ
|
|||
|
|
private string _Title;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Title
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Title;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Title = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Link;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>Ƶ<EFBFBD><C6B5><EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Link
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Link;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Link = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Description;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Description
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Description;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Description = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region <EFBFBD><EFBFBD>ѡ
|
|||
|
|
private string _Category;
|
|||
|
|
/// <summary>
|
|||
|
|
/// Ϊ feed <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Category
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Category;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Category = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Author;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>涨<EFBFBD><E6B6A8>Ŀ<EFBFBD><C4BF><EFBFBD>ߵĵ<DFB5><C4B5><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ַ
|
|||
|
|
/// </summary>
|
|||
|
|
public string Author
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Author;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Author = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Comments;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>ӵ<EFBFBD><D3B5>йش<D0B9><D8B4><EFBFBD>Ŀ<EFBFBD><C4BF>ע<EFBFBD>ͣ<EFBFBD><CDA3>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Comments
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Comments;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Comments = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Enclosure;
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ý<EFBFBD><C3BD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Enclosure
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Enclosure;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Enclosure = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Guid;
|
|||
|
|
/// <summary>
|
|||
|
|
/// Ϊ <20><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ψһ<CEA8>ı<EFBFBD>ʶ<EFBFBD><CAB6>
|
|||
|
|
/// </summary>
|
|||
|
|
public string Guid
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Guid;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Guid = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _PubDate;
|
|||
|
|
/// <summary>
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3B7A2B2><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public string PubDate
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _PubDate;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_PubDate = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
private string _Source;
|
|||
|
|
/// <summary>
|
|||
|
|
/// Ϊ<><CEAA><EFBFBD><EFBFBD>Ŀָ<C4BF><D6B8>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ
|
|||
|
|
/// </summary>
|
|||
|
|
public string Source
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _Source;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
_Source = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// RSS <20><>ö<EFBFBD><C3B6>
|
|||
|
|
/// </summary>
|
|||
|
|
public enum RssItemName
|
|||
|
|
{
|
|||
|
|
Title,
|
|||
|
|
Link,
|
|||
|
|
Description,
|
|||
|
|
Category,
|
|||
|
|
Author,
|
|||
|
|
Comments,
|
|||
|
|
Enclosure,
|
|||
|
|
Guid,
|
|||
|
|
PubDate,
|
|||
|
|
Source
|
|||
|
|
}
|
|||
|
|
}
|