title: In C#, how do you check if a path is virtual or not?
body: <p>Possible virtual paths:</p>
  
  <pre><code>/folder1/folder2/image.jpg
  ~/folder1/folder2/image.jpg
  folder1/folder2/image.jpg
  </code></pre>
  
  <p>Concrete path:</p>
  
  <pre><code>C:\folder1\folder2\image.jpg
  D:\folder1\folder2\image.jpg
  C:/folder1/folder2/image.jpg
  C:/folder1\folder2/image.jpg
  </code></pre>
  
  <p>How do you check whether a path is virtual or not in a way that's not prone to failure? The reason why I'm asking is because when I use <code>Server.MapPath()</code> on a concrete path, it will throw an exception. However, what I'm passing to <code>Server.MapPath()</code> can be any one of the examples I provided above and I don't know what it is before run-time.</p>