Run app from xml file

diablo21

New member
Joined
Jan 4, 2011
Messages
3
Programming Experience
Beginner
Hi all,
If i post in wrong section please move the thread to the right place..

Here is what i need:

my request is simply and i have posted my source to take a look on it,
to see that i has 3 buttons :
- GS1 Start
- GS2 Start
- GS3 Start
So i want to make from this buttons when they click , on the buttons to open the requested information that is putted in Configuration.xml file

Example:
I press button "GS1 Start" and will open me the file that is putted in
[Path]
GameServer1 = C:\2\
[File]
GameServer1 = GameServer.exe
[Port]
GameServer1 = 127.0.0.1 55907

and the same stuff for the other 2 buttons
and when the program crashed (closed) to show message in Label2 with text "gameserver 1 or 2 or 3 has crashed, restart after %seconds...
and to reload the gameserver 1 or 2 or 3 that has crashed
This is what i want from 4 days....
So comeone if someone knows more vb.net to help me with this so i can finaly close this thread and continued with my project

here is my source code
MEGAUPLOAD - The leading online storage and file delivery service

can someone help me make this to run it by the buttons, to write the log in label2 and to restart the program if its closed after %seconds
 
hi,

1st: this
[Path]
GameServer1 = C:\2\
[File]
GameServer1 = GameServer.exe
[Port]
GameServer1 = 127.0.0.1 55907
is NOT a xml, that's an ini file.

2: if you want to use xml it's VERY simple in .net
use this to create the xml
VB.NET:
DIM DS as new dataset
DS.Tables.Add("INI")
DS.Tables("INI")
DS.Tables("INI").Columns.Add("Path")
DS.Tables("INI").Columns.Add("File")
DS.Tables("INI").Columns.Add("Port")
DS.Tables("INI").Rows.Add(  <<< put the values you need on each column in a param array, repeat for as many servers you need
DS.WriteXml(fileName)
and now you have the xml file your application can easily read from; it also serves as an example on how .net formats xml files

now to read it:
VB.NET:
DIM DS as new dataset
DS.ReadXml(filename)
dim ServerPath as string = DS.Tables(0).Rows(0).Item("Path").ToString


but if you only have a little bit of data you can also store it on the Resources or Settings which you can access on design-time through the MyProject icon on the solution explorer.
 
my source is complate about the xml file
i only need now how to run the application that is insered in the configuration.xml file
by pressing the buttons to open the program and if its crashed to show the message and reload the program

3 things that i need:
- By buttons to run the app
- If crashed to display in Label2 the message
- If the program crashed and is AutoRestart = 1 then to autorestart the app that has crashed and to reload it after %seconds (Time = 5)
this is what is missing in the program
 
Back
Top