Windows App w/ Cmd Line Parameters

G

Guest

Hi,

I'm creating a windows forms application. Users will normally launch this
app from a Windows shortcut, but I need to give them an option of starting
with command line arguments for integration with another program.

I was able to do this by using Sub Main as a startup object, but the program
terminates as soon as Sub Main completes. I tried adding parameters to the
"New" method of the startup form, but it only allows this if I make the
parameters optional, and it dosen't pass the values into the procedure.

Is there any way to either:
- Pick-up command line arguments with a Form as the startup object, or
- Stop the program from terminating when Sub Main completes?

Thanks for your help
 
M

Mattias Sjögren

- Pick-up command line arguments with a Form as the startup object, or

System.Environment.GetCommandLineArgs()
- Stop the program from terminating when Sub Main completes?

If you have a call to Application.Run in Main, it will not return
until the main form has closed.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top