/ Published in: C#
URL: http://www.jonasjohn.de/snippets/csharp/is-folder.htm
This is a little helper function to check whether a given path is a folder or a file.
Expand |
Embed | Plain Text
/// <summary> /// Returns true if the given file path is a folder. /// </summary> /// <param name="Path">File path</param> /// <returns>True if a folder</returns> public bool IsFolder(string path) { return ((File.GetAttributes(path) & FileAttributes.Directory) == FileAttributes.Directory); }
You need to login to post a comment.
