Share Pastebin
Guest
Private paste!

Untitled

By: a guest | Apr 24th, 2010 | Syntax: VB.NET | Size: 0.58 KB | Hits: 120 | Expires: Never
Copy text to clipboard
  1. Imports System.IO
  2. Imports System.Xml
  3.  
  4. Module Module1
  5.  
  6.     Sub Main(ByVal sArgs() As String)
  7.  
  8.         Dim Xml As String
  9.         Xml = System.IO.File.ReadAllText("news_google.xml")
  10.  
  11.         Dim doc As XmlDocument = New XmlDocument()
  12.         doc.LoadXml(Xml)
  13.  
  14.         Dim n As XmlNode = doc.SelectSingleNode("//rss/channel/title")
  15.  
  16.         Dim nodeName As String = n.Name
  17.         Dim title As String = n.InnerText
  18.  
  19.         Console.WriteLine("Node name: {0}", nodeName)
  20.         Console.WriteLine("Node contents: {0}", title)
  21.  
  22.         Console.ReadLine()
  23.     End Sub
  24. End Module