title: C# Pass a file via command line
body: <p>My Programm is supposed to read the file and count the number of vowels and consonants in it. So, the fileName must be passed as a command line argument. This is part of my code:</p>
  
  <pre><code>class FileDetails 
  {
      static void Main(string[] args) 
      {
  
          Console.WriteLine(args.Length); 
          foreach (string arg in args)
          { 
              Console.WriteLine(arg); 
          }
      }
  }
  </code></pre>
  
  <p>After compilation of this file, I run it via command line and pass some arguments to the Main function:</p>
  
  <pre><code>C:\Users\StepN\Desktop\FILEDETAILS&gt;filedetails abc def xyz
  </code></pre>
  
  <p>The result of programm looks like this:</p>
  
  <pre><code>3
  abc
  def
  xyz
  </code></pre>
  
  <p>So, the root of the problem is that I need to pass as a command line argument the filename, but I don't know, how to do it.</p>
  
  <p>Thanks in advance for any help!</p>