title: Filter out Temporary Files from a Directory.GetFiles List C#
body: <p>I am trying to only keep files with the file extensions .SLDPRT, .SLDASM, and .SLDDRW.  However, I keep getting hidden temporary files that begin with ~$ like C:\directory\~$IamAtemporaryfile.sldprt .  What are your suggestions to get rid of those?</p>
  
  <pre><code>string[] solidworksFileList = Directory.GetFiles(args[0], "*.SLD???", 
  SearchOption.AllDirectories).Where(str =&gt; str.EndsWith(".SLDPRT", 
  StringComparison.OrdinalIgnoreCase) || str.EndsWith(".SLDASM", 
  StringComparison.OrdinalIgnoreCase) || str.EndsWith(".SLDDRW", 
  StringComparison.OrdinalIgnoreCase)).ToArray();
  </code></pre>