Command Line

  • Thread starter Thread starter Omar Abid
  • Start date Start date
O

Omar Abid

Hi developer,
I'm writing a command line that accept arguments
So i can use it like ping " Ping adressip "
I mean arguments (adressip)
I used the following method
Module Main
Sub main ( Byval args() as string)
Coding...
End sub
The problem that i can't use a string but an array
so if i replace with the following
Sub main (Byval args as string)
Coding..
End sub
an error occured
Any body have an idea
 
Hi developer,
I'm writing a command line that accept arguments
So i can use it like ping " Ping adressip "
I mean arguments (adressip)
I used the following method
Module Main
Sub main ( Byval args() as string)
Coding...
End sub
The problem that i can't use a string but an array
so if i replace with the following
Sub main (Byval args as string)
Coding..
End sub
an error occured
Any body have an idea

It's an array to allow for multiple parameters seperated by spaces
like "ping -a ipaddress." If you just want a single string just use a
for loop and reconstruct the string from the array.

i.e.

Sub Main(args As String())
Dim param As String = ""
For Each arg As String in args
param &= arg & " "
Next

'// Use param string from now on
End Sub

Thanks,

Seth Rowe
 
Back
Top