I'm putting together a simple console app in C# to do some basic stuff against SharePoint.
I have a main method which accepts some args. I call the app from a batch file i.e.
How could I go about making the tool to accept switches i.e.
Basically what I don't know is how can I have the -o, -username, -useremail type switches built in to my code?
My code so far is very basic and start with...
Any ideas?
I have a main method which accepts some args. I call the app from a batch file i.e.
Code:
MyApp arg1 arg2 arg3
How could I go about making the tool to accept switches i.e.
Code:
MyApp -o AddUser -username "someuser" -useremail "someemail"
Basically what I don't know is how can I have the -o, -username, -useremail type switches built in to my code?
My code so far is very basic and start with...
Code:
static int Main(string[] args)
{
//the args are separated by comma in my batch file
string something = args[0];
string something1 = args[1];
string something2 = args[2];
//code to use the args goes here
}
Any ideas?