RSS解析上次构建日期。请尽快做到最快

时间:2010-06-03 19:15:21

标签: vb.net rss parsing

    Dim myRequest As System.Net.WebRequest = System.Net.WebRequest.Create(url)
    Dim myResponse As System.Net.WebResponse = myRequest.GetResponse()
    Dim rssStream As System.IO.Stream = myResponse.GetResponseStream()
    Dim rssDoc As New System.Xml.XmlDocument()
    Try
        rssDoc.Load(rssStream)
    Catch nosupport As NotSupportedException
        Throw nosupport
    End Try
    Dim rssItems As System.Xml.XmlNodeList = rssDoc.SelectNodes("rss/channel")
    'For i As Integer = 0 To rssItems.Count - 1
    Dim rssDetail As System.Xml.XmlNode
    rssDetail = rssItems.Item(0).SelectSingleNode("lastBuildDate")

这就是我用来解析上次更新时间的RSS源的问题。有更快的方法吗?速度似乎有点慢,因为它在解析之前会拉下整个Feed。

1 个答案:

答案 0 :(得分:0)

使用XMLReader类来读取数据。一旦找到所需内容,就可以终止数据流。