'Common C#/C# 기본 문법 연구'에 해당되는 글 12건
- 2008.11.14 Threading
- 2008.10.01 숨겨진 폴더 지울려면.. ^^
With an instance of a DirectoryInfo class in hand that references the directory you want to make hidden in, you need only examine/set the Attributes property with the FileAttributes.Hidden flag ala:
DirectoryInfo di = new DirectoryInfo(@"C:\SomeDirectory");
//See if directory has hidden flag, if not, make hidden
if( (di.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden)
{
//Add Hidden flag
di.Attributes = di.Attributes | FileAttributes.Hidden;
}
//See if directory has hidden flag, if not, make visible
if ((di.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
{
//Remove Hidden flag
di.Attributes = di.Attributes ^ FileAttributes.Hidden;
}