Results 1 to 2 of 2

Thread: Vb.net & Xml

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Location
    UK, Wales
    Posts
    9

    Unhappy Vb.net & Xml

    Hi all,

    I'm trying to link a XML file stored online to my client side windows application, the windows application will when detects a internet connection, it will display the information from the XML file.

    I just dont know where to start, can anyone help

    Thanks

    Lee

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Both the XMlDocument object and the Dataset object can load xml files and if you pass a url instead of a local path it will still retrieve the file.

    VB Code:
    1. 'using an XMLDocument
    2.         Dim xDoc As New Xml.XmlDocument()
    3.         xDoc.Load("http://mage.edneeis.com/_private/traffic.xml")
    4.         'get a node
    5.         Dim xNode As Xml.XmlNode = xDoc.SelectSingleNode("Traffic/AutoLogins")
    6.  
    7.         'using a Dataset
    8.         Dim ds As New DataSet()
    9.         ds.ReadXml("http://mage.edneeis.com/_private/traffic.xml")
    10.  
    11.         'show results
    12.         MsgBox(String.Format("Total Hits= {0} : Auto Logins= {1}", ds.Tables(0).Rows(0)("TotalHits").ToString, xNode.InnerText))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width