title: GetCommandLineArgs is not returning what I expected
body: <p>I recently started studying C# through the book and I came to this example where I'm trying to print out arguments passed from the command prompt:</p>
  
  <pre><code>namespace SimpleCSharpApp
  {
      class Program
      {
          static void Main()
          {
              string[] theArgs = Environment.GetCommandLineArgs();
  
              foreach(string arg in theArgs)
                  Console.WriteLine("Arg: {0}", arg);
          }
      }
  }
  </code></pre>
  
  <p>My command prompt <strong>input</strong> looks like this:</p>
  
  <p><em>D:\...\SimpleCSharpApp\bin\Debug>SimpleCSharpApp.exe arg1 arg2</em></p>
  
  <p>And the <strong>output</strong> looks like this:</p>
  
  <p>Arg: SimpleCSharpApp.exe</p>
  
  <p>Arg: arg1</p>
  
  <p>Arg: arg2</p>
  
  <p>What I supposed it would look like is:</p>
  
  <p>Arg: arg1</p>
  
  <p>Arg: arg2</p>
  
  <p>My question is, why does it recognize my execution command as a member of string arguments? What am I supposed to change to get the output I expected?</p>
  
  <p>I could just change foreach loop into for loop starting from the 2nd element like this:</p>
  
  <pre><code>namespace SimpleCSharpApp
  {
      class Program
      {
          static void Main()
          {
              string[] theArgs = Environment.GetCommandLineArgs();
  
              for (int i = 1; i &lt; theArgs.Length; i++)
              {
                  Console.WriteLine("Arg: {0}", theArgs[i]);
              }
          }
      }
  }
  </code></pre>
  
  <p>But this does not resolve my curiosity, can I somehow make it not to record executable file like an argument and print it out with foreach loop to get the output I expected?</p>
  
  <p><strong>Thanks in advance!</strong></p>