By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,301 Members | 3,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,301 IT Pros & Developers. It's quick & easy.

Command Line Arguments

P: n/a
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

Dec 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.

-----
Tim Patrick - www.timaki.com
Start-to-Finish Visual Basic 2005
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

Dec 4 '06 #2

P: n/a
"Milan" <mi********@googlemail.comschrieb:
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Dec 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.