Passing command line arguments to vb.net
-
I know this should be simple but I can't get it to work. Isn't there a way to pass command line arg's to a vb.net program without have to use the vb6 class? I search help but I must haver it installed incorrectly becuase it keeps saying it is updating my recent changes? Thanks Tom Tom
-
I know this should be simple but I can't get it to work. Isn't there a way to pass command line arg's to a vb.net program without have to use the vb6 class? I search help but I must haver it installed incorrectly becuase it keeps saying it is updating my recent changes? Thanks Tom Tom
Sure. You can use the System.Environment class to get the command line arguments in a String array. Something like this should work for you:
Dim arguments As [String]() = System.Environment.GetCommandLineArgs()
The System.Environment class will also let you get the entire command line as a String, get at environment variables, get and set the exit code of your app, current directory, NETBIOS machine name, ... Docs on the class can be found here[^] on MSDN. RageInTheMachine9532
-
Sure. You can use the System.Environment class to get the command line arguments in a String array. Something like this should work for you:
Dim arguments As [String]() = System.Environment.GetCommandLineArgs()
The System.Environment class will also let you get the entire command line as a String, get at environment variables, get and set the exit code of your app, current directory, NETBIOS machine name, ... Docs on the class can be found here[^] on MSDN. RageInTheMachine9532