This is from a newer C# guy,
I have been back and forth through different questions posed on here but I haven't found anything that answers directly to what I need to know.
I have a console application that I want to pass arguments to, through the command line. This is what I have so far and it's working for a single argument, now I got to add another but I can't seem to figure out where to start.
static void Main(string[] args)
{
if (args == null || args.Length== 0)
{
Console.WriteLine("that's not it");
help();
}
else
{
for (int i = 0; i < args.Length; i++)
{
backupfolder = args[i];
}
checks();
}
}
If I take everything out of my else statement how can I set what the args are and assign? Will the below work ?
static void Main(string[] args)
{
if (args == null || args.Length== 0)
{
Console.WriteLine("that's not it");
help();
}
else
{
string backupfolder = args[0];
string filetype = args[1];
checks();
}
}