title: C# check if you have passed arguments or not
body: <p>I have this code:</p>
  
  <pre><code>public static void Main(string[] args)
  {         
      if (string.IsNullOrEmpty(args[0]))  // Warning : Index was out of the bounds of the array
      {
          ComputeNoParam cptern = new ComputeNoParam();
          cptern.ComputeWithoutParameters();
      }
      else
      {
          ComputeParam cpter = new ComputeParam();
          foreach (string s in args){...}
      }
  }
  </code></pre>
  
  <p>Also tried <code>if(args.Length==0)</code>, but it still doesn't work.</p>
  
  <p>Basically I want to find out if the user called the program with arguments. If not the program will ask for input.</p>
  
  <p>How can I do this?
  Thanks in advance.</p>