title: C# Code - How to count the amount of files ia .7z
body: <p>I am searching for a way to open a .7z file and to get the amount/number of zipped content inside there by using C# Code.       </p>
  
  <pre><code>string[] directoryPaths = Directory.GetDirectories(@"heregoesmypath");
  
  foreach (string dircetory in directoryPaths)
  {
     int fileCount = (from file in Directory.EnumerateFiles(@dircetory, "*", SearchOption.AllDirectories) select file).Count();
  
     string text = fileCount.ToString() + " Files of: " + "????" + " Files in Directory : " + dircetory;
  
  try
  {
     File.AppendAllText(_yourfile, text + Environment.NewLine + Environment.NewLine);
  }
  
  catch (Exception ex)
  {
     MessageBox.Show(ex.ToString());
  }
              string[] zippeddirectoryPaths = Directory.GetFiles(@"myresultpath");
  
              foreach (string exdircetory in zippeddirectoryPaths)
                  {
  
                     // FileInfo info = new FileInfo(exdircetory);
                     // var test = info.Length;
                     // MessageBox.Show(test.ToString() + "Bytes");
                     // var test2 = info.Extension;
                     // MessageBox.Show(test2.ToString() + "Format");}
                     // var test3 = Empty;
                     // here must be a methode, which count my amount of files on the   
                     //  .7z file and save it in var test3
  </code></pre>
  
  <p>That is my code so far... Instead of the last 5 lines bevore i need that methode getting the number of files in a .7z file.</p>
  
  <p>In the manually way you would have a File, you do a right klick go on 7-Zip and klick open.
  The 7-Zip UI opens and offers you a button Properties. If you klick on that button, another window opens with shows you the amount/numbers of files and folders.</p>
  
  <p>So at all I do not prefer to do that manually if I have zipped lots of files and folders. I like to get a way in C# to save my result in a var, so that i can use them later in my code to write a logging.</p>
  
  <p>So please give me suggestions or example code to solve that problem.</p>