Application Development Using Visual Basic® and .NET
by Robert J. Oberg, Peter Thorsteinson, Dana L. Wyatt
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access