title: Relative path to absolute path in VB.NET
body: <p>I am writing a VB.NET console application where it takes relative paths and spits out all file names, or an error for invalid input. I am having trouble getting PhysicalPath from relative path</p>
  
  <p>Example:</p>
  
  <ol>
  <li><p>I am in folder <code>C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj\bin\Debug</code></p></li>
  <li><p>My application, <code>SP.exe</code>, is also in the same folder.</p></li>
  <li><p>I run: <code>"SP.exe ..\"</code>. The output will be a list of all files in the folder <code>"C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj\bin"</code></p></li>
  <li><p>I run: <code>"SP.exe ..\\..\"</code>. The output will be a list of all files in the folder <code>"C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj"</code></p></li>
  <li><p>I run: <code>"SP.exe ..\\..\\..\"</code>. The output will be a list of all files in the folder <code>"C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol"</code></p></li>
  </ol>
  
  <p>Currently I am handling one relative path, but no more:</p>
  
  <pre><code>    If Source.IndexOf("..\") = 0 Then
          Dim Sibling As String = Directory.GetParent(Directory.GetCurrentDirectory()).ToString()())
          Source = Source.Replace("..\", Sibling)
      End If
  </code></pre>
  
  <p>How can I easily handle multiple <code>..\</code>?</p>