You can use the System.Environment.GetCommandLineArgs method to retrieve the
command line arguments in the form of an array of strings. The First
argument is the full path of your application executable
(GetCommandLineArgs(0)) - the remaining will be the arguments that you
provide on the command line. Then you can use various string functions to
retrieve the relevant values from the arguments. For instance, for the
argument that you've mentioned, you could do something like this (watch for
typos - typed directly here):
Dim arg1 As String = _
System.Environment.GetCommandLineArgs(1)
Dim ID As Integer = Integer.Parse( _
arg1.SubString(arg0.IndexOf("/cid:") + 1))
This will give you the customer ID 12353.
hope that helps..
Imran.
"Stewart Saathoff" <sd********@hotmail.com> wrote in message
news:eA**************@TK2MSFTNGP10.phx.gbl...
Hello,
I was wondering if anyone knows how to parse command line variables upon
execution of an application. For example, I want to be able to type this
at a command line: "myapp.exe /cid:12353" and have "myapp.exe" open and
display a record for a client with the id of 12353.
Does anyone know how to do that. Currently I have a text box on my form
that if I enter 12353 and hit enter, the record will appear. I want this
to be possible through a command line however.
Thanks in advance.