我有一个指向dir的绝对本地路径: "file:\\C:\\Users\\john\\documents\\visual studio 2010\\Projects\\proj"
但是当我试图将它扔进DirectoryInfo我的ctor时,我得到了"不支持URI格式"的例外.
我用Google搜索并查看了SO,但我只看到了远程路径的解决方案,而不是本地解决方案.我期待某种转换方法......
Mar*_*ell 180
string uriPath =
"file:\\C:\\Users\\john\\documents\\visual studio 2010\\Projects\\proj";
string localPath = new Uri(uriPath).LocalPath;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
95003 次 |
| 最近记录: |