Home All Groups Group Topic Archive Search About

Checking whether "SomeString" is Directory or File...

Author
10 Mar 2005 1:43 PM
Kerem Gümrükcü
Hi,

how can i find out, whether a given string specifies a Path or a file...

System.IO.File.Exist(UnknownString) does not work for my
application. i exactly need to know if the strng is a path or a file...

But how the h*** can i find it out....


Thanks in advance....


Kerem Gümrükcü
Author
10 Mar 2005 2:34 PM
Morten Wennevik
Hi Kerem,

Please do not multipost,  see my answer in the csharp group.
The method won't work if you are trying to determine if a string is a 
valid path (though maybe not on your system)  If that is your goal, you 
may need to check the string for characters defined in the 
Path.InvalidPathChars property.

--
Happy Coding!
Morten Wennevik [C# MVP]

Bookmark and Share