Application Command Line Arguments

  • Thread starter Thread starter Daryll Shatz
  • Start date Start date
D

Daryll Shatz

Can someone point me to some information on how to include application
command line arguments with a Windows application.

Can this still be done in VB .NET?

Thanks
 
* "Daryll Shatz said:
Can someone point me to some information on how to include application
command line arguments with a Windows application.

Can this still be done in VB .NET?

\\\
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
///

In order to test the samples above, you must set the application's
startup object to 'Sub Main'. The 2nd sample code can be used at any
place inside a Windows Forms application too.
 
Back
Top