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

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -