Example #1
0
        private void button6_Click(object sender, EventArgs e)
        {
            FwkGlobalCatalog        wFwkGlobalCatalog = new FwkGlobalCatalog();
            List <FwkGlobalCatalog> list        = new List <FwkGlobalCatalog>();
            GlobalCatalogCollection cataloglist = null;

            try
            {
                cataloglist = adADWrapper.GlobalCatalogs(txtDomainC.Text);
            }
            catch (Exception ex)
            {
                lblResult.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
                return;
            }
            foreach (GlobalCatalog gc in cataloglist)
            {
                wFwkGlobalCatalog            = new FwkGlobalCatalog();
                wFwkGlobalCatalog.IPAddress  = gc.IPAddress;
                wFwkGlobalCatalog.Name       = gc.Name;
                wFwkGlobalCatalog.DomainName = gc.Domain.Name;

                list.Add(wFwkGlobalCatalog);
            }

            dataGridView1.DataSource = list;
            dataGridView1.Refresh();
        }