日期:2014-05-18 浏览次数:20440 次
FileInfo file = new FileInfo(Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["dbFile"].ToString())); if((file.Attributes&FileAttributes.ReadOnly)!=0) { file.Attributes = FileAttributes.Normal; } FileSecurity fs = file.GetAccessControl(); fs.AddAccessRule(new FileSystemAccessRule("EveryOne", FileSystemRights.FullControl, AccessControlType.Allow)); file.SetAccessControl(fs);