Command (line args)

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
 
P

Peter Foot [MVP]

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
 
Joined
Oct 21, 2006
Messages
3
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top