Reading command line arguments
Hi,
How can I receive command line arguments in VB.net ?
I want to recieve the string arguments and based on the argument I want to make certain buttons on my windows form visible or invisible.
Thanks,
Hi,
How can I receive command line arguments in VB.net ?
I want to recieve the string arguments and based on the argument I want to make certain buttons on my windows form visible or invisible.
Thanks,
Public Sub Main(ByVal sArgs() As String) 'Note the declaration of the Sub Main line 'It has the sArgs parameter. This parameter is handled by 'the system, and contains any command line arguments. If sArgs.Length = 0 Then 'If there are no argumentsConsole.WriteLine( "<-no arguments passed->") Else 'We have some arguments Dim i As Integer = 0 While i < sArgs.Length 'So with each argumentConsole.WriteLine( "Argument" & ctype(i, string) & " " & sArgs(i) ) 'Print out each itemi = i + 1 'Increment to the next argument End While End If End Sub |