Bagikan melalui


Rss20FeedFormatter.ReadFrom(XmlReader) Metode

Definisi

Membaca umpan sindikasi RSS 2.0 dari instans yang ditentukan XmlReader .

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)

Parameter

reader
XmlReader

untuk XmlReader membaca dari.

Contoh

Kode contoh berikut menunjukkan cara menggunakan metode ReadFrom(XmlReader).

Rss20FeedFormatter feedFormatter = new Rss20FeedFormatter();
XmlReader rssReader = XmlReader.Create("http://Contoso/Feeds/MyFeed");
if (feedFormatter.CanRead(rssReader))
{
    feedFormatter.ReadFrom(rssReader);
    rssReader.Close();
}
Dim feedFormatter As New Rss20FeedFormatter()
Dim rssReader As XmlReader = XmlReader.Create("http://Contoso/Feeds/MyFeed")
If feedFormatter.CanRead(rssReader) Then
    feedFormatter.ReadFrom(rssReader)
    rssReader.Close()
End If

Berlaku untuk