Command Line Arguments

  • Thread starter Thread starter Milan
  • Start date Start date
M

Milan

Hi,

Please guide me how to set command line argument and
how to retrive command line argument.

Senario: vb.net application should be able to execute from command
prompt by passing login and password and should be able to execute
process form (with his parameter)
User should not be able to see GUI

Milan
 
Visual Basic includes a "Command" function that provides all command-line
arguments as an entire string. In VB2005, you can also use the My.Application.CommandLineArgs
property, which provides a collection of the individual arguments.

When running your program within Visual Studio, you can set temporary command-line
arguments through the Project Properties form. Choose the Debug tab, and
then fill in the "Command line arguments" field as needed.
 
Milan said:
Please guide me how to set command line argument and
how to retrive command line argument.

Senario: vb.net application should be able to execute from command
prompt by passing login and password and should be able to execute
process form (with his parameter)
User should not be able to see GUI

Select 'Sub Main' in the project's properties as startup object and add this
code to your project:

\\\
Public Module Program
Public Sub Main(ByVal Args() As String)
If Args.Length > 0 Then
If ... Then
Application.Run(New MainForm())
Else
...
End If
Else
...
End If
End Sub
End Module
///
 
Back
Top