在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