File के Attributes Retrieve करने के लिए, FileAttributes Enumeration का उपयोग करें। इसमें Compressed, Directory, Hidden आदि जैसे विभिन्न Members होते हैं।
Check करने के लिए कि File Hidden है या नहीं, Hidden Member Name का उपयोग करें।
यदि FileAttributes.Hidden Set है तो इसका मतलब File Hidden है। सबसे पहले, Attributes Find करने के लिए Path Get करें।
FileAttributes attributes = File.GetAttributes(path);
यदि निम्न Set है, तो Hidden Member Name का उपयोग करके File अब Hidden है।
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden); Console.WriteLine("The {0} file is hidden.", path);