public bool IsDirectory(string path)
{
try
{
FileAttributes attr = System.IO.File.GetAttributes(path);
if ((attr & FileAttributes.Directory) == FileAttributes.Directory)
{
return true;
}
return false;
}
catch (FileNotFoundException)
{
return false;
}
catch (DirectoryNotFoundException)
{
return false;
}
}
No comments:
Post a Comment