Atom10ItemFormatter.ReadFrom(XmlReader) 方法

定義

從指定的 XmlReader 執行個體讀取 Atom 1.0 新聞訂閱項目。Reads an Atom 1.0 syndication item from the specified XmlReader instance.

public:
 override void ReadFrom(System::Xml::XmlReader ^ reader);
public override void ReadFrom (System.Xml.XmlReader reader);
override this.ReadFrom : System.Xml.XmlReader -> unit
Public Overrides Sub ReadFrom (reader As XmlReader)

參數

reader
XmlReader

要從其中讀取的 XmlReaderThe XmlReader to read from.

範例

下列程式碼將示範如何使用 ReadFrom(XmlReader) 方法。The following code shows how to use the ReadFrom(XmlReader) method.

Atom10ItemFormatter itemFormatter = new Atom10ItemFormatter();
XmlReader atomReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Item");
if (itemFormatter.CanRead(atomReader))
{
    itemFormatter.ReadFrom(atomReader);
    atomReader.Close();
}
Dim itemFormatter As New Atom10ItemFormatter()
Dim atomReader As XmlReader = XmlReader.Create("http://Contoso/Feeds/MyFeed/Item")
If itemFormatter.CanRead(atomReader) Then
    itemFormatter.ReadFrom(atomReader)
    atomReader.Close()
End If

適用於