O'Reilly logo

Application Development Using Visual Basic® and .NET by Dana L. Wyatt, Peter Thorsteinson, Robert J. Oberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Command-Line Arguments

Command-line arguments are provided as an array of String objects obtained via the Environment.GetCommandLineArgs method.[1] An integer exit code can be returned to the operating system via the Environment.ExitCode property to indicate the overall success or failure of the program upon termination. This is useful for controlling batch scripts or other programs that execute your VB.NET program. The Environment class provides access to other useful information, such as environment strings and the current directory. This example is provided in the AccessEnvironmentInfo directory.

[1] To establish command-line arguments within Visual Studio, right-click on the project node (not the solution node) in Solution Explorer, choose ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required