How to exit a method, instead of raise new Exception or return in console application.
if (!String.IsNullOrEmpty(args[i + 1].ToString()))
{
inputFilePath = args[i + 1].ToString();
}
else
{
//code to exit console application run
}
How to exit a method, instead of raise new Exception or return in console application.
if (!String.IsNullOrEmpty(args[i + 1].ToString()))
{
inputFilePath = args[i + 1].ToString();
}
else
{
//code to exit console application run
}
If you are trying to exit your program do return
if you want to return an exit status (as this SO answer says) make your main's return type int and return an int.