コード例 #1
0
ファイル: Form1.cs プロジェクト: JamesMcDermott/Share-Auditor
 public Form1()
 {
     InitializeComponent();
     ucProgress = new UC_Progress(this);
     ucAudit    = new UC_Audit(this, ucProgress, auditLocation_Setting, exportLocation_Setting, includeAdministrator_Setting, numLevels_Setting);
     panel_UCContainer.Controls.Add(ucAudit);
 }
コード例 #2
0
ファイル: Audit.cs プロジェクト: JamesMcDermott/Share-Auditor
        // Entry point for the audit - manages the various configurations surrounding the audit
        public Audit(Form1 _form1, UC_Progress _ucProgress, string _auditLocation, string _exportLocation, string numLevelsDeep, bool _auditEventLogs, bool _showSystemAccounts)
        {
            this.form1              = _form1;
            this.ucProgress         = _ucProgress;
            this.auditLocation      = _auditLocation;
            this.exportLocation     = _exportLocation;
            this.auditEventLogs     = _auditEventLogs;
            this.showSystemAccounts = _showSystemAccounts;
            this.ucAudit            = _form1.ucAudit; // Access ucAudit instance from form1 field

            // Check how many levels deep the application needs to scan and audit
            calculateHowManyLevelsDeepToScan(numLevelsDeep);

            // Configure logging
            log = new Logs();
            log.generateFileName(exportLocation, "permissions", "csv");

            // Background worker for scanning and reporting
            bgWorker_Audit = new BackgroundWorker();
            bgWorker_Audit.WorkerReportsProgress = true;
            bgWorker_Audit.DoWork               += new DoWorkEventHandler(bgWorker_Scan_DoWork);
            bgWorker_Audit.RunWorkerCompleted   += new RunWorkerCompletedEventHandler(bgWorker_Scan_RunWorkerCompleted);
            bgWorker_Audit.WorkerReportsProgress = true;
            bgWorker_Audit.RunWorkerAsync();
        }
コード例 #3
0
 public UC_Audit(Form1 f, UC_Progress ucP, string auditLocation_Setting, string exportLocation_Setting, string includeAdministrator_Setting, string numLevels_Setting)
 {
     InitializeComponent();
     this.ucProgress = ucP;
     this.form1      = f;
     displayError("", true);
     tb_auditLocation.Text  = auditLocation_Setting;
     tb_exportLocation.Text = exportLocation_Setting;
     populateComboBox(numLevels_Setting);
     this.ActiveControl = label_ErrorMessage;
 }