Skip to content

Instantly share code, notes, and snippets.

@longtth
Created March 23, 2018 05:13
Show Gist options
  • Save longtth/aec062b713482c01d3486c0b56cf5a62 to your computer and use it in GitHub Desktop.
Save longtth/aec062b713482c01d3486c0b56cf5a62 to your computer and use it in GitHub Desktop.
public class FileDirChecker
{
public bool isDirectory(string path)
{
bool ret = false;
// get the file attributes for file or directory
FileAttributes attr = File.GetAttributes(path);
if (attr.HasFlag(FileAttributes.Directory))
ret = true;
else
ret = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment