Parsing Parameters

Leeus

Regular
Joined
Dec 23, 2002
Messages
50
Hi all, in VB6 it was easy to pick up stuff from the command line to my exe. I would use for example "test.exe 2254 1145748" and use the command function to retrieve them, this is not a console application and is a windows app in VB.net, how is it done???

Many thanks!
 
Also if you need to split the arguments use

Environment.GetCommandLineArgs

GetCommandLineArgs is a Array

E.g.

RUN.EXE param1 param2

Environment.GetCommandLineArgs(0) Will return param1
Environment.GetCommandLineArgs(1) Will return param2

Andy
 
Visual Basic:
Msgbox("When you opened this program you gave the parameters " & environment.commandline)

Thats it nice and simple :)

Andy
 
Back
Top