Need case-sensitive file search in VB.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to determine if a specified path exists, including the case, but .net
isn't making this easy.

system.io.file.exists is case-insensitive. If I create a fileinfo object in
hopes to retrieve the FullName property, or use
System.IO.Path.GetFullPath(Path), the exact case used in the search is
returned. In other words, if I ToLower the path, I get a LC path returned.

Any suggestions?
 
My guess would be that you have the proper case if you enumerate the
directories from the parent object (something like
di=di.Parent.GetDirectories(di.Name)(0) where di is the DirectoryInfo you
previously found).

You may want to elaborate a bit what is the exact problem it causes in your
application
 
Back
Top