首页  编辑  

控制某个文件或目录的属性

Tags: /C#/文件目录操作/   Date Created:

using System . IO;

FileInfo vFileInfo = new FileInfo ( @"c:\temp\temp.swf" );

vFileInfo . Attributes = FileAttributes . ReadOnly | FileAttributes . Hidden;

// and

DirectoryInfo vDirectoryInfo = new DirectoryInfo ( @"c:\temp" );

vDirectoryInfo . Attributes = FileAttributes . ReadOnly | FileAttributes . Hidden;