예제 #1
0
        public void AccessControlEditorTest()
        {
            var dlg = new AccessControlEditorDialog()
            {
                ElevationRequired = true, OwnerElevationRequired = true, AllowEditOwner = true
            };

            //dlg.Flags = SI_OBJECT_INFO_Flags.SI_EDIT_OWNER | SI_OBJECT_INFO_Flags.SI_EDIT_AUDITS | SI_OBJECT_INFO_Flags.SI_ADVANCED | SI_OBJECT_INFO_Flags.SI_RESET | SI_OBJECT_INFO_Flags.SI_EDIT_PROPERTIES | SI_OBJECT_INFO_Flags.SI_EDIT_EFFECTIVE | SI_OBJECT_INFO_Flags.SI_RESET_SACL;
            //dlg.ResourceType = AccessControlEditorDialog.TaskResourceType; dlg.ObjectName = @"AUScheduledInstall";
            dlg.Initialize(new System.IO.FileInfo(@"C:\Temp\help.ico"));
            dlg.ShowDialog();

            dlg.Initialize(new System.IO.DirectoryInfo(@"C:\Temp"));
            dlg.ShowDialog();

            dlg.Initialize(Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Console"));
            dlg.ShowDialog();
        }
예제 #2
0
파일: Tests.cs 프로젝트: kouweizhong/vanara
 public static void AclEditorDialogDir(Form parentForm)
 {
     using (var aclEditorDialog1 = new AccessControlEditorDialog())
     {
         aclEditorDialog1.Flags = AclUI.SI_OBJECT_INFO_Flags.SI_EDIT_OWNER | AclUI.SI_OBJECT_INFO_Flags.SI_EDIT_AUDITS | AclUI.SI_OBJECT_INFO_Flags.SI_CONTAINER | AclUI.SI_OBJECT_INFO_Flags.SI_ADVANCED | AclUI.SI_OBJECT_INFO_Flags.SI_EDIT_EFFECTIVE | AclUI.SI_OBJECT_INFO_Flags.SI_VIEW_ONLY;
         aclEditorDialog1.Initialize(@"C:\HP", null, ResourceType.FileObject);
         var res = aclEditorDialog1.ShowDialog(parentForm);
         AddTestResult(null, "Run dir", $"{res}: {aclEditorDialog1.ObjectIsContainer}:{aclEditorDialog1.Sddl}");
     }
 }
예제 #3
0
파일: Tests.cs 프로젝트: kouweizhong/vanara
 public static void AclEditorDialogReg(Form parentForm)
 {
     using (var aclEditorDialog1 = new AccessControlEditorDialog())
     {
         using (var key = Registry.CurrentUser.OpenSubKey("Software", RegistryKeyPermissionCheck.Default, RegistryRights.ReadKey))
         {
             aclEditorDialog1.Initialize(key);
             var res = aclEditorDialog1.ShowDialog(parentForm);
             AddTestResult(null, "Run reg", $"{res}: {aclEditorDialog1.ObjectIsContainer}:{aclEditorDialog1.Sddl}");
         }
     }
 }
예제 #4
0
        static void DirectTest()
        {
            var dlg = new AccessControlEditorDialog()
            {
                ElevationRequired = true, OwnerElevationRequired = true, AllowEditOwner = true
            };

            //dlg.ResourceType = AccessControlEditorDialog.TaskResourceType; dlg.ObjectName = @"AUScheduledInstall";
            dlg.Initialize(new System.IO.FileInfo(@"C:\Temp\ida.ico"));
            //dlg.Initialize(new System.IO.DirectoryInfo(@"C:\Temp"));
            //dlg.Initialize(Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Test"));
            dlg.ShowDialog();
        }