String strFileName = @"C:\test.txt";
FileInfo fileInfo = new FileInfo(strFileName);
fileInfo.Attributes = FileAttributes.Hidden;// 隱藏資料夾
String strDirName = @"C:\test";
DirectoryInfo diMyDir = new DirectoryInfo(strDirName);
diMyDir.Attributes = FileAttributes.Hidden;Ref: http://msdn.microsoft.com/zh-tw/library/system.io.filesysteminfo.attributes.aspx
沒有留言:
張貼留言