c# - how to make a folder undeletable? -
How do I create a folder undeletable?
Alternatively, I close the Windows user to remove it.
Regards.
You use the method. There is an example on that link, but here it is only in the case:
Public Static Zero AddDirectorySecurity (string filename, string account, file system rights rights, AccessControlType ControlType) {// A new directoryInfo Object Create DirectoryInfo dInfo = New Directory Info (FileName); // Get a directory security object that represents the current security settings. DirectorySecurity dSecurity = dInfo.GetAccessControl (); // Add FileSystemAccessRule to Security Settings DSecurity.AddAccessRule (New FileSystemAccessRule (Account, Rights, ControlType)); // Set new access settings dInfo.SetAccessControl (dSecurity); }
Comments
Post a Comment