SyndicationFeed.Load 方法

定义

重载

Load(XmlReader)

从指定的 XML 读取器加载联合源。

Load<TSyndicationFeed>(XmlReader)

从指定的 SyndicationFeed 加载一个 XmlReader 派生实例。

Load(XmlReader)

Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs

从指定的 XML 读取器加载联合源。

public:
 static System::ServiceModel::Syndication::SyndicationFeed ^ Load(System::Xml::XmlReader ^ reader);
public static System.ServiceModel.Syndication.SyndicationFeed Load (System.Xml.XmlReader reader);
static member Load : System.Xml.XmlReader -> System.ServiceModel.Syndication.SyndicationFeed
Public Shared Function Load (reader As XmlReader) As SyndicationFeed

参数

reader
XmlReader

要从其中加载源的 XmlReader

返回

一个包含已加载内容的 SyndicationFeed

示例

下面的示例演示如何调用此方法。

XmlReader reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml");
SyndicationFeed feed = SyndicationFeed.Load(reader);
Dim reader As XmlReader = XmlReader.Create("http:'localhost/feeds/serializedFeed.xml")
Dim feed As SyndicationFeed = SyndicationFeed.Load(reader)

适用于

Load<TSyndicationFeed>(XmlReader)

Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs
Source:
SyndicationFeed.cs

从指定的 SyndicationFeed 加载一个 XmlReader 派生实例。

public:
generic <typename TSyndicationFeed>
 where TSyndicationFeed : System::ServiceModel::Syndication::SyndicationFeedgcnew() static TSyndicationFeed Load(System::Xml::XmlReader ^ reader);
public static TSyndicationFeed Load<TSyndicationFeed> (System.Xml.XmlReader reader) where TSyndicationFeed : System.ServiceModel.Syndication.SyndicationFeed, new();
static member Load : System.Xml.XmlReader -> 'SyndicationFeed (requires 'SyndicationFeed :> System.ServiceModel.Syndication.SyndicationFeed and 'SyndicationFeed : (new : unit -> 'SyndicationFeed))
Public Shared Function Load(Of TSyndicationFeed As {SyndicationFeedNew}) (reader As XmlReader) As TSyndicationFeed

类型参数

TSyndicationFeed

联合源的类型。

参数

reader
XmlReader

要从其中进行读取的 XmlReader

返回

TSyndicationFeed

一个包含源的 SyndicationFeed 派生实例。

例外

读取过程中遇到无效的 XML。

示例

下面的代码演示如何从 XmlReader 实例加载联合源。

XmlReader reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml");
SyndicationFeed feed = SyndicationFeed.Load(reader);
Dim reader As XmlReader = XmlReader.Create("http:'localhost/feeds/serializedFeed.xml")
Dim feed As SyndicationFeed = SyndicationFeed.Load(reader)

注解

若要将联合项加载到从 SyndicationFeed 派生的类中,可以使用此方法。

适用于