Command Prompt

  • Thread starter Thread starter Luis
  • Start date Start date
L

Luis

Hello,

I want to start an application writen in VB.net by a
commmand prompt.
This application will put on a textbox one string
(string1) and in another textbox another string (string2).

The strings are given in command Prompt as the example:

"c:\programs\tests\test.exe string1 string2"

So, how can I read this strings when my application loads

Thanks in advance,

Luis
 
* "Luis said:
I want to start an application writen in VB.net by a
commmand prompt.
This application will put on a textbox one string
(string1) and in another textbox another string (string2).

The strings are given in command Prompt as the example:

"c:\programs\tests\test.exe string1 string2"

So, how can I read this strings when my application loads

\\\
Public Sub Main(ByVal astrCmdLineArgs() As String)
Dim i As Integer
For i = 0 To astrCmdLineArgs.Length - 1
Console.WriteLine(astrCmdLineArgs(i))
Next i
End Sub
///

- or -

\\\
Public Sub Main()
Dim i As Integer
For i = 0 To Environment.GetCommandLineArgs().Length - 1
Console.WriteLine(Environment.GetCommandLineArgs(i))
Next i
End Sub
///
 
Back
Top