[RESOLVED] Launch program with arguments passed from another application
Gentlemen,
I have an application made by a Vendor that sends a set of arguments to an application I am working on.
I am unsure how to "launch" my application with these arguments. The vendor's app is a service that runs and launches my application when necessary.
I'm assuming i need to modify the main form's constructor, but not sure.
Re: Launch program with arguments passed from another application
the format of the arguments I am to receive is this:
vb Code:
live live 100.100.100.100 53705 16 NAME May-29-2009 01:32:03 PM 0061
I believe they are all strings
Re: Launch program with arguments passed from another application
For others wanting this functionality, here is the code. I had a hard time finding it on the web even though it is a one-liner.
vb.net Code:
Dim arg() As String = Environment.GetCommandLineArgs()
It returns an array of all the command line arguments. You must convert each argument to its correct datatype when using it. Also, the first argument is the path to the executable, so you should start fetching arguments at index 1.
Hope this helps.