How to get folder permission by specific username
DirectorySecurity
dSecurity = Directory .GetAccessControl( @"C:\Testfolder" );
foreach ( FileSystemAccessRule rule in dSecurity.GetAccessRules( true , true , typeof ( Testuser )))
{
Console .WriteLine( "Account:{0}\nRights:{1}" , rule.IdentityReference.Value,
rule.FileSystemRights.ToString());
}
Console .ReadLine();
Support@Mytechnet.me
No comments:
Post a Comment