Ran*_*pho 44
string path = Path.GetFullPath("C:\\foo\\..\\bar"); // path = "C:\\bar"
Run Code Online (Sandbox Code Playgroud)
你有没有尝试过
string path = Path.GetFullPath(@"C:\foo\..\bar");
Run Code Online (Sandbox Code Playgroud)
在C#中使用System.IO.Path类?