Dim fileSec = System.IO.File.GetAccessControl("폴더", Security.AccessControl.AccessControlSections.Access)
Dim accessRules = fileSec.GetAccessRules(True, True, GetType(System.Security.Principal.NTAccount))
For Each rule As System.Security.AccessControl.FileSystemAccessRule In accessRules
MsgBox(rule.IdentityReference.Value)
MsgBox(rule.AccessControlType.ToString())
MsgBox(rule.FileSystemRights.ToString())
Next
vnote
Dim myinfo As New DirectoryInfo("d:\1")
Dim dSecurity As DirectorySecurity = myinfo.GetAccessControl()
Dim fSecurity As AuthorizationRuleCollection = _
dSecurity.GetAccessRules(True, True,
Type.GetType("System.Security.Principal.NTAccount"))
For Each myacc As Security.AccessControl.AccessRule In fSecurity
If (myacc.AccessControlType = AccessControlType.Allow) Then
MsgBox("o:")
ElseIf (myacc.AccessControlType = AccessControlType.Deny) Then
MsgBox("z")
End If
Next
이 댓글을