title: Determining if file exists using c# and resolving UNC path
body: <p>I am trying to write a function to determine if a file exists. The two methods prove to return inconsistent results (fileExists() seems to provide accurate results, compared to isFileFound(), that returns false positives - i would have expected an exception when trying to create the instance). </p>
  
  <pre><code>protected bool isFileFound(string path, string fileName)
      {
          System.IO.FileInfo fi = null;
  
          bool found = false;
          try
          {
              fi = new System.IO.FileInfo(path + fileName);
              found = true;
          }
          catch (Exception e)
          {
              baselogger.Fatal(e.Message + " " + e.StackTrace + " \n" + path + fileName);
          }
  
          return found;
      }
  
      protected bool fileExists(string path, string pattern)
      {
          bool success = false;
  
          try
          {
              success = File.Exists(path + pattern);
          }
          catch (Exception e)
          {
              baselogger.Warn(e.Message + " " + e.StackTrace + " " + e.Source);
          }
  
          return success;
      }
  </code></pre>
  
  <p>Neither seems to be able to resolve a UNC path of the following syntax: <strong><em>\\abcserver\c$\xyzfolder\foo.bar</em></strong></p>
  
  <p>Any idea why the unc path is failing for these methods would be greatly appreciated.</p>