Home All Groups Group Topic Archive Search About

Command line parameters

Author
7 Apr 2006 5:29 PM
John
I use VB .NET 2003 and work on a WinForm based app. This app takes some
parameters from command line when starting. What project properties can I set
so I can see those parameters in debug mode?

Thanks.

Author
7 Apr 2006 7:51 PM
Mattias Sjögren
John,

>I use VB .NET 2003 and work on a WinForm based app. This app takes some
>parameters from command line when starting. What project properties can I set
>so I can see those parameters in debug mode?

In the project properties you can only set the command line arguments.
It's under Configuration Properties, Debugging, Start Options.

To see them at runtime you have to write your own code to output them
to the debug output window, a message box or wherever you want them to
appear. If you write your own Sub Main you can just take a string
array as input and write that out. Otherwise you can call
Environment.GetCommandLineArgs to retrieve the arguments.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.