title: How to count number of Excel files from a folder using c#?
body: <p>I need to count the number of excel files,pdf files from a directory. </p>
  
  <p>I have Counted the total number of files from a directory using</p>
  
  <pre><code> System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"D:\");
   int count = dir.GetFiles().Length; 
  </code></pre>
  
  <p>Any Suggestion?</p>