How to check whether a file has a Hidden Attribute or not?

 Posted by vishalneeraj-24503 on 11/12/2014 | Category: Visual Studio Interview questions | Views: 2618 | Points: 40
Answer:

We will write below code to check whether a file has a Hidden Attribute or not:-

if(((File.GetAttributes(filePath) & FileAttributes.Hidden) == FileAttributes.Hidden))

{
return true;
}
return false;


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response