Start Application with External Arguments

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi All,

I want get arguments/parameters in a vb.net Console/Windows application.

e.g. c:\MyApp.exe Parm1 Parm2

Please tell me if it is available. I cannot found in any help or msdn.

Quickfox49
 
There ya go !

Module Module1

Sub Main(ByVal args() As String)

Dim i As Int32

For i = 0 To args.Length - 1

Console.WriteLine(args(i))

Next

Console.ReadLine()

End Sub

End Module


Regards - OHM

news.microsoft.com said:
Hi All,

I want get arguments/parameters in a vb.net Console/Windows
application.

e.g. c:\MyApp.exe Parm1 Parm2

Please tell me if it is available. I cannot found in any help or
msdn.

Quickfox49

Regards - OHM# (e-mail address removed)
 
news.microsoft.com said:
I want get arguments/parameters in a vb.net Console/Windows
application.

e.g. c:\MyApp.exe Parm1 Parm2

Please tell me if it is available. I cannot found in any help or
msdn.

shared sub Main(Args as string())
console.writeline string.join(vbcrlf, Args)
end sub

or: System.Environment.GetCommandLineArgs
or: Microsoft.VisualBasic.Interaction.Command

For testing purposes in the IDE, you can set the arguments in the project
properties: Configuration properties -> Debug: Command line arguments
[____________________]
 
Back
Top