Re: App design advise by Tom
Tom
Wed Apr 23 15:31:51 CDT 2008
On 2008-04-23, Bill McCarthy <Bill@N0SPAM.com> wrote:
>
> "Tom Shelton" <tom_shelton@YOUKNOWTHEDRILLcomcast.net> wrote in message
> news:ejxDQzXpIHA.3408@TK2MSFTNGP03.phx.gbl...
>>
>> If your asking how to get command line parameters, then in VB.NET you
>> have several choices....
>>
>> Use a main method as your startup object:
>>
>> Sub Main(ByVal args() As String)
>> Function Main(ByVal args() As String) As Integer
>>
>> The function Main lets you return a value to the OS.
>>
>> Or, you can use:
>>
>> Command
>> My.Application.CommandLineArgs
>> System.Environment.CommandLine
>> System.Environment.GetCommandLineArgs()
>>
>> So you have lots of choices. The right one depends on your application
>> really. If you are going to use the VB.NET application framework, then
>> you will not want to use the Main method - but, use one of the other
>> options.
>>
>
> And you can also use the My Application framework. Create a winforms app in
> VB, then from the My Project pages, select the Application tab and click on
> View Application Events. There you can handle the Me.Startup as well as the
> Me.StartupNextInstance events, where the e.CommandLine returns a readonly
> collection of the command line arguments.
>
Didn't know about that one :) Thanks.
--
Tom Shelton