草庐IT

GetExactPathName

全部标签

.net - 使用 .NET 在 Windows 上获取实际文件名(使用适当的大小写)

我想做与thisquestion中完全相同的事情:Windowsfilesystemiscaseinsensitive.How,givenafile/foldername(e.g."somefile"),Igettheactualnameofthatfile/folder(e.g.itshouldreturn"SomeFile"ifExplorerdisplaysitso)?但我需要在.NET中执行此操作并且我想要完整路径(D:/Temp/Foobar.xml而不仅仅是Foobar.xml)。我看到FileInfo类上的FullName没有用。 最佳答案