Getting actual file name (with proper casing) on Windows with .NET

后端 未结 6 402
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 17:31

I want to do exactly the same as in this question:

Windows file system is case insensitive. How, given a file/folder name (e.g. \"somefile\"), I get t

6条回答
  •  抹茶落季
    2020-12-05 17:45

    I think the only way you are going to be able to do this is by using the same Win32 API, namely the SHGetFileInfo method, mentioned in the accepted answer for the question you reference. In order to do this, you will need to use some interop p/invoke calls. Take a look at pinvoke.net for an example of how to do this and what additional structs you will need.

提交回复
热议问题