reading commandlines and arguments

TonyT

New member
Joined
Jan 5, 2005
Messages
2
Programming Experience
Beginner
Hi!
I'm using visual studio 2003, VB.NET and projectplattform: smartDevice application.

I'm trying to create an application, exe-file that shall perform this:

1. user calls the file: run c:\createXML.exe /2 /3 /8
2. a function in this exe-file will read these arguments (2,3,8 ) and creates a xmlfile containing these values.
3. close this application.

That's it...

So, the question is:
How can I read the arguments? I got a small code for this but it doesn't work in this plattform, here it is:

Code:
dim strArguments() as string
dim strArgument as string

strArguments() = System.Environment.GetCommandLineArgs()
strArgument = strArguments(0) '---> value = /2



Is there any other way to pick up the arguments (command line) for this plattform?

/TonyT
 
as esplained here: http://www.vbdotnetforums.com/showthread.php?t=1306

dim strArguments() as string = System.Environment.GetCommandLineArgs()

the first one strArguments(0) is always the path&name of the application

strArguments(1) is "/2"
strArguments(2) is "/3"
strArguments(3) is "/8"

and so on
 
Hi, thank you for your hint, but this "System.Environment.GetCommandLineArgs" does not excist for "smart device application". GetCommandLineArgs is missing... :(

Is there any other way? or do I have to import some special namespaces for it?

/Tony
 
Last edited:
all .net applications require the .net framework system.evironment.getcommandlinearges is in that required .net framework

so i dunno why it's telling you it's not there....
 
Back
Top