How do I resolve a canonical filename in Windows?

前端 未结 8 1375
自闭症患者
自闭症患者 2020-12-29 13:18

If I have a string that resolves to a file path in Windows, is there an accepted way to get a canonical form of the file name?

For example, I\'d like to know whether

8条回答
  •  北海茫月
    2020-12-29 13:32

    I would use System.IO.Path.GetFullPath. It takes a string as an input (C:\stuff\things\etc\misc\other..\whatever.txt in your case) and will output a string (C:\stuff\things\etc\misc\whatever.txt).

提交回复
热议问题