Hello,
I try to resolve a little problem. I want to build a very simple programm. A Windows Form Application with just one Label (this is just 4fun / education how to do it)
The Label should text out a Name or something from a XML file on my Webserver.
I found a nice "Console" Application which works just fine but i consider myself still as a beginner... So, Console is not Form Application.
This Works fine. But how can i output strings on Labels, Textboxes etc...?
PLS as simple as possible.
Thank you.
I try to resolve a little problem. I want to build a very simple programm. A Windows Form Application with just one Label (this is just 4fun / education how to do it)
The Label should text out a Name or something from a XML file on my Webserver.
I found a nice "Console" Application which works just fine but i consider myself still as a beginner... So, Console is not Form Application.
This Works fine. But how can i output strings on Labels, Textboxes etc...?
PLS as simple as possible.
Thank you.
VB.NET:
Imports System.Net
Imports System.IO
Imports System.Xml
Module Module1
Sub Main()
Dim URL As String
URL = "http://www.w3schools.com/xml/note.xml"
Try
Dim Request As WebRequest = HttpWebRequest.Create(URL)
Dim Response As WebResponse = Request.GetResponse
Dim sReader As New StreamReader(Response.GetResponseStream())
Dim xmlDoc As New XmlDocument()
xmlDoc.Load(sReader)
Dim TitleNode As XmlNodeList = xmlDoc.GetElementsByTagName("note")
Console.WriteLine("To: " + TitleNode.Item(0).Item("to").InnerText)
Console.WriteLine("From: " + TitleNode.Item(0).Item("from").InnerText)
Console.WriteLine("Heading: " + TitleNode.Item(0).Item("heading").InnerText)
Console.WriteLine("Body: " + TitleNode.Item(0).Item("body").InnerText)
Console.ReadKey()
Catch ex As Exception
Console.WriteLine(ex.Message)
Console.ReadKey()
End Try
End Sub
End Module