Is there a way to have a case sensitive Directory.Exists
/ File.Exists
since
Directory.Exists(folderPath)
and
Directory.Exists(folderPath.ToLower())
both return true
?
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%.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With