468,315 Members | 1,404 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,315 developers. It's quick & easy.

Need case-sensitive file search in VB.net

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?
Jul 11 '06 #1
1 1713
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

--
Patrice

"Todd Beaulieu" <To**********@discussions.microsoft.coma écrit dans le
message de news: 66**********************************@microsoft.com...
>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?

Jul 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by mike | last post: by
1 post views Thread by Mike | last post: by
19 posts views Thread by Fran?ois Laroche | last post: by
3 posts views Thread by moondaddy | last post: by
13 posts views Thread by vgame64 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.