title: Is there a .NET Framework method for converting file URIs to paths with drive letters?
body: <p>I was looking for something like Server.MapPath in the ASP.NET realm to convert the output of Assembly.GetExecutingAssembly().CodeBase into a file path with drive letter.</p>
  
  <p>The following code works for the test cases I've tried:</p>
  
  <pre>
  private static string ConvertUriToPath(string fileName)
  {
      fileName = fileName.Replace("file:///", "");
      fileName = fileName.Replace("/", "\\");
      return fileName;
  }
  </pre>
  
  <p>It seems like there should be something in the .NET Framework that would be much better--I just haven't been able to find it.</p>