string path = "d:\\sufeinet.com";
//判断是不是只读文件
if (File.GetAttributes(path) == FileAttributes.Hidden || File.GetAttributes(path) == FileAttributes.ReadOnly)
{
//设置为非只读文件
System.IO.DirectoryInfo dif = new DirectoryInfo(path);
dif.Attributes = FileAttributes.Archive;
}
string path = "d:\\sufeinet.com";
//设置只读文件
System.IO.DirectoryInfo dif = new DirectoryInfo(path);
dif.Attributes = FileAttributes.ReadOnly;
欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |