English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

4 answers

In VB.NET 2005, here is the easiest way, with the command line already parsed down to parameters.

My.Application.CommandLineArgs

You can access the number of parameters in
My.Application.CommandLineArgs.Count

Ex:

If My.Application.CommandLineArgs.Count = 1 Then
If My.Application.CommandLineArgs(0) = "sometext" Then
MessageBox.Show("First argument value is sometext")
End If
End If

2007-08-10 09:37:20 · answer #1 · answered by vincentb 1 · 0 0

In a console app static void Main() is Main(String[] args)

args are the parameters being passed in
for example from command prompt
myprogram.exe john doe

arg[0] = john
arg[1] = doe

2007-08-10 09:17:23 · answer #2 · answered by dickersonka 2 · 0 0

Environment.CommandLine

Example:

myString=Environment.CommandLine

2007-08-10 09:18:04 · answer #3 · answered by Big John Studd 7 · 0 0

Console.Read() or Console.ReadLine() could help.

Check out:
http://msdn2.microsoft.com/en-us/library/system.console_methods.aspx

2007-08-10 09:06:21 · answer #4 · answered by jn 1 · 0 0

fedest.com, questions and answers