I made a hidden directory in drive F and named it "File".
This code shows it is hidden file : Console.WriteLine(dc.Attributes);
But when I use DirectoryInfo Attributes to check if it's a hidden file it won't work.
Here is the code :
DirectoryInfo dc = new DirectoryInfo(@"F:\File");
Console.WriteLine(dc.Attributes);
if (dc.Attributes == FileAttributes.Hidden)
{
Console.WriteLine("HIDDEN");
}
else
{
Console.WriteLine("NOT HIDDEN");
}
It writes NOT HIDDEN
. What should I do with that?
Thanks in advance