Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[VB] [2012] three node strings one text box?

Junior Spellweaver
Joined
Apr 16, 2013
Messages
147
Reaction score
19
trying to get 3 nodes strings to display in one text box, but i think im declaring them wrong.

any one able to point me in the right way?

Code:
       count = New XmlTextReader(url:="http://www.deltatao.com/clanlord/status/cldata.xml")        count.Read()
        While (count.Read())
            Dim type = count.NodeType
            play.Invoke(Sub()
                            If (count.Name = "population") Then


                                play.Visible = True
                                play.Text = count.ReadInnerXml.ToString()


                            End If
                        End Sub)


            TextBox1.Invoke(Sub()
                                If (count.Name = "messenger") Then


                                    Dim messenger As String = count.Name = "messenger"
                                    Dim awardee As String = count.Name = count.Name = "awardee"
                                    Dim messenge As String = count.Name = count.Name = "messenge"


                                    TextBox1.Visible = True
                                    TextBox1.Text = ("messenger" + "awardee" + "messenge")
                                    TextBox1.Update()


                                End If
                            End Sub)
 
◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜
Developer
Joined
May 29, 2007
Messages
2,167
Reaction score
898
You are reading wrong trough the xml file + you are declaring your variable and overwriting it a few times with other values which isn't needed, you just need to declare your variable.

article will explain how to read an xml file correctly.
 
Junior Spellweaver
Joined
Apr 16, 2013
Messages
147
Reaction score
19
i know im declaring it wrong, and the rest is setup the same as that artical tells you, but i cant find a away to "save" the string from the xml document., then add it to the text feild of the text box.
 
BloopBloop
Joined
Aug 9, 2012
Messages
892
Reaction score
275
i know im declaring it wrong, and the rest is setup the same as that artical tells you, but i cant find a away to "save" the string from the xml document., then add it to the text feild of the text box.

If you are not bound to .NET 2.0 , i would advice to take a look at XElement's , i do prefer them above the XmlReader class. With this class , you can loop over all the elements and "simply" do, something like this:

Code:
foreach(var ele in XElement.Load(Path).Elements())
{
Console.WriteLine("Name:{0} value:{1}",ele.Name,ele.Value);
}


 
Last edited:
Back
Top