quick and dirty:
In the past I have created a FileInfo object from the path string and then used the FullName property. This removes all of the ..'s and the .'s.
Of course you could interop:
[DllImport("shlwapi", EntryPoint="PathCanonicalize")]
private static extern bool PathCanonicalize(
StringBuilder lpszDst,
string lpszSrc
);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…