I have a tool which I want to run from my command prompt.
The code is as
static void Main(string[] args) { string User; if (args[0].Length != 0) { User = args[0]; } else { Console.Write("Please Enter the Username"); User = Console.ReadLine(); } If I didnt give the username or the first argument after my 'tool.exe' in command prompt, it throws an exception like "Index was outside the bounds of the array"
I want ouptut as, if I didnt give argument - it should prompt me to give the username. please help me out.