Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
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)