title: Best way to read commandline parameters in console application
body: <p>Below are two ways of reading in the commandline parameters.  The first is the way that I'm accustom to seeing using the parameter in the main.  The second I stumbled on when reviewing code.  I noticed that the second assigns the first item in the array to the path and application but the first skips this.  </p>
  
  <p>Is it just preference or is the second way the better way now?</p>
  
  <pre><code>Sub Main(ByVal args() As String)
      For i As Integer = 0 To args.Length - 1
          Console.WriteLine("Arg: " &amp; i &amp; " is " &amp; args(i))
      Next
  
      Console.ReadKey()
  End Sub
  </code></pre>
  
  <p><br><br></p>
  
  <pre><code>Sub Main()
      Dim args() As String = System.Environment.GetCommandLineArgs()
  
      For i As Integer = 0 To args.Length - 1
          Console.WriteLine("Arg: " &amp; i &amp; " is " &amp; args(i))
      Next
  
      Console.ReadKey()
  End Sub
  </code></pre>
  
  <p>I think the same can be done in C#, so it's not necessarily a vb.net question.</p>