区分大小写Directory.Exists / File.Exists [英] Case sensitive Directory.Exists / File.Exists
本文介绍了区分大小写Directory.Exists / File.Exists的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法让敏感案件 Directory.Exists
/ File.Exists
,因为
Is there a way to have a case sensitive Directory.Exists
/ File.Exists
since
Directory.Exists(folderPath)
和
Directory.Exists(folderPath.ToLower())
真正?
>大部分的时间没关系,但我用这似乎不是如果路径不匹配的情况下100%的工作的宏。
Most of the time it doesn't matter but I'm using a macro which seems not to work if the path doesn't match cases 100%.
推荐答案
由于Directory.Exists用途的 用FindFirstFile这是不区分大小写的,没有。但是你可以的PInvoke FindFirstFileEx 设置为FIND_FIRST_EX_CASE_SENSITIVE
Since Directory.Exists uses FindFirstFile which is not case-sensitive, no. But you can PInvoke FindFirstFileEx with an additionalFlags parameter set to FIND_FIRST_EX_CASE_SENSITIVE
这篇关于区分大小写Directory.Exists / File.Exists的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文