Command Prompt

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
 
H

Herfried K. Wagner [MVP]

* "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
///
 

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