1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
Function droit(ByVal dir As String, ByVal user As String)
Dim sec As FileSecurity = New FileSecurity(dir, AccessControlSections.All)
Dim dacl As AuthorizationRuleCollection = sec.GetAccessRules(True, True, GetType(NTAccount))
For Each rqt As FileSystemAccessRule In dacl
Dim N = 2
Dim T() As String = {rqt.IdentityReference.Value, rqt.AccessControlType.ToString, rqt.FileSystemRights.ToString}
T(0) = rqt.IdentityReference.Value
T(1) = rqt.AccessControlType.ToString
T(2) = rqt.FileSystemRights.ToString
Dim AChercher As String = "TEST\Util2"
Dim i As Integer
For i = 0 To N
If T(0).ToString = AChercher Then
ListBox1.Items.Add(dir + "" + T(0) + "" + T(1) + "" + T(2))
End If
Next i
Next |