J
Jeff Gaines
I am writing an app where I want to save a directory path, provided it
exists.
If a user enters a path 'c:\temp' I can set up a new DirectoryInfo and
check it exists. Unfortunately the data inside the DirectoryInfo returns
the path as 'c:\temp' whereas it is actually 'C:\Temp'.
Case insensitivity is useful in checking for the existence of a directory
but I do want to save the properly cased name.
Any thoughts on how to achieve this? I can create another DirectoryInfo
from the parent of the first and this produces properly cased names but
then I need to iterate thought it to match the name I am looking for.
exists.
If a user enters a path 'c:\temp' I can set up a new DirectoryInfo and
check it exists. Unfortunately the data inside the DirectoryInfo returns
the path as 'c:\temp' whereas it is actually 'C:\Temp'.
Case insensitivity is useful in checking for the existence of a directory
but I do want to save the properly cased name.
Any thoughts on how to achieve this? I can create another DirectoryInfo
from the parent of the first and this produces properly cased names but
then I need to iterate thought it to match the name I am looking for.