Skip to main content

Posts

Showing posts with the label C# : Programmatically Adding and Remove Permissions for a specific user

C# : Programmatically Adding and Remove Permissions for a specific user

string strRootFolder = "FolderPath";  AddDirectorySecurity(strRootFolder + "\\" + txtFolderName.Text, getAccountName(), getFolderRight(false, true),  AccessControlType.Allow);         private FileSystemRights getFolderRight(bool isWrite, bool isRead)         {             try             {                 if (isWrite)                     return FileSystemRights.Write;                 if (isRead)                     return FileSystemRights.Read;             }             catch (Exception ex)             {                 clsErrorHandling _clsErrorHandling = n...