폴더 권한 가져오기

 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

이 게시물을

댓글'1'

 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

이 댓글을

공유하기

SEARCH

MENU NAVIGATION