title: Using Directory.Exists on a network folder when the network is down
body: <p>My company's code base contains the following C# line:</p>
  
  <pre><code>bool pathExists = Directory.Exists(path);
  </code></pre>
  
  <p>At runtime, the string <code>path</code> happens to be the address of a folder on the company's intranet - something like <code>\\company\companyFolder</code>. When the connection from my Windows machine to the intranet is up, this works fine. However, when the connection goes down (as it did today), executing the line above causes the application to freeze completely. I can only shut the application down by killing it with the Task Manager.</p>
  
  <p>Of course, I would rather have <code>Directory.Exists(path)</code> return <code>false</code> in this scenario. Is there a way to do this?</p>