Dragon10

HI!,

any idea how to create this

Just like C++ or C, e.g. let's said application called test.exe.

where you call this application, you specify with test.exe -s or test.exe -en or test.exe -test

Thanks,

Alex



Re: Visual C# 2008 (Pre-release) option for execute C# application

ralf_oop

In the project properties -> tab debug you can set the command line arguments.






Re: Visual C# 2008 (Pre-release) option for execute C# application

Dragon10

by the way, how to specify multiple arguments like this -a,-b,-c or -a;-b-;-c

Then, how to select them

@lex





Re: Visual C# 2008 (Pre-release) option for execute C# application

ben2004uk

All the agruments are passed in as an array, in a console application it is in the args array.

Code Snippet

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

}

}

}

The other way is using the Environment object which can be accessed anywhere inside your application. This works in any type of C# project.

Code Snippet
string
[] args = Environment.GetCommandLineArgs();

Once you have them inside an aray, you can decide how you want to accept and process the agruments.

Ben