Nicky wrote:
If I got a path like C:\testfile , how can I tell it is a file, not a
folder? This file does not have a extension name.
You can create a FileInfo (or DirectoryInfo, doesn't matter) and check
the attributes.
FileInfo fileInfo = new FileInfo(@"c:\testfile");
if ((fileInfo.Attributes & FileAttributes.Directory) > 0)
... now you know it's a directory.
But of course the other answers to your question are just as valid.
Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619
http://www.sturmnet.org/blog