title: C# "Command-Line arguments exception"
body: <p>How can I store a string command line argument in to a self defined string variable. As it tend to give "Array Index out of Range Bounds"...</p>
  
  <p>Here is the code,</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace Prac1_e
  {
      class Program
      {
          static void Main(string[] args)
          {
              Console.WriteLine("Enter a String and a number : ");
              Console.Read();
              string str = args[0];
              int n = Convert.ToInt32(args[1]);
              Console.WriteLine(str);
              Console.WriteLine(n);
              Console.ReadKey();
          }
      }
  }
  </code></pre>