Command (line args)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

in vb.net (Pocket PC 2003 project) i get an NotSupportedException when i try
to use the "Command" Function to get the line command args,
My.Application.CommandLineArgs is not supported in compact framework 2,

is there any other way ?

Thanks for your help
 
If you manually create a Sub Main as the startup object in your project you
can declare it like so

Public Sub Main(ByVal args() As String)

End Sub

And then access the arguments from within this method or store them in a
publicly accessible collection.

Peter
 
vb.net solution

You can use this:

Function GetCommandLineArgs() As String()
' Declare variables.
Dim separators As String = " "
Dim commands As String = Microsoft.VisualBasic.Interaction.Command()
Dim args() As String = commands.Split(separators.ToCharArray)
Return args
End Function

Ciao

Johnny
 
Back
Top