public static bool IsFolder(string path) { return File.GetAttributes(path).HasFlag(FileAttributes.Directory); }