Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.
AddDirectorySecurity((userDirectory), Me.AccountName.Text, FileSystemRights.ReadAndExecute, AccessControlType.Allow)
Sub AddDirectorySecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType) ' Get a DirectorySecurity object that represents the current security settings. Dim dSecurity As DirectorySecurity = Directory.GetAccessControl(FileName) ' Add the FileSystemAccessRule to the security settings (**following is one line of code**). dSecurity.AddAccessRule(New FileSystemAccessRule(Account, Rights, (InheritanceFlags.ContainerInherit + InheritanceFlags.ObjectInherit), PropagationFlags.InheritOnly, ControlType)) ' Set the new access settings. dSecurity.SetAccessRuleProtection(True, True) Directory.SetAccessControl(FileName, dSecurity)
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.