在WinApp我只是想从一个Uri对象获得的绝对路径路径:Uri.AbsolutePath弄乱了空间
Uri myUri = new Uri(myPath); //myPath is a string
//somewhere else in the code
string path = myUri.AbsolutePath;
这工作正常,如果我原来的路径没有空格。如果有空格,那么这个字符串就会被破坏;例如'Documents and settings'成为'Documents%20and%20Setting'等。
任何帮助将不胜感激!
编辑: 本地路径,而不是AbsolutePath的伎俩!
纸条给所有:这是编码无知 – JohnIdol 2009-01-12 21:23:50