Пример #1
0
        public ImportFromAD(IPersistence persistence)
        {
            InitializeComponent();

            this.persistence = persistence;
            this.gridComputers.AutoGenerateColumns = false;

            adClient = new ActiveDirectoryClient();
            adClient.ListComputersDone += new ListComputersDoneDelegate(this.AdClient_OnListComputersDone);
            adClient.ComputerFound += new ComputerFoundDelegate(this.OnClientComputerFound);

            var computers = new SortableList<ActiveDirectoryComputer>();
            this.bsComputers.DataSource = computers;
        }
Пример #2
0
 private void ScanADButton_Click(object sender, EventArgs e)
 {
     this.progressBar1.Visible = true;
     Network.ActiveDirectoryClient adClient = new ActiveDirectoryClient();
     adClient.OnListComputersDoneDelegate += new ActiveDirectoryClient.ListComputersDoneDelegate(adClient_OnListComputersDoneDelegate);
     adClient.ListComputers(this.domainTextbox.Text);
 }