Tags

FileAttributes attribute = File.GetAttributes(@”C:\path.txt”);
if (attribute.HasFlag(FileAttributes.Directory))
{
Console.WriteLine(“Given input is File.”); //”C:\path.txt” is the input
}

Advertisements