Click here to Skip to main content
15,886,689 members
Articles / Programming Languages / C#

Simple Active Directory Browser Dialog

Rate me:
Please Sign up or sign in to vote.
4.00/5 (16 votes)
25 Mar 20071 min read 79.7K   3.5K   47  
Folder/File-like Browser Dialog for Active Directory Objects
using System;
using System.Collections.Generic;
using System.Text;


namespace DirectoryServicesBrowser
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Loaded DirectoryServicesBrowserDialog");
            DirectoryServicesBrowserDialog DirectoryBrowser =
                            new DirectoryServicesBrowserDialog(null, null);
            DirectoryBrowser.ShowDialog();

            Console.WriteLine("Name: " + DirectoryBrowser.ObjectName);
            Console.WriteLine("Path: " + DirectoryBrowser.ObjectPath);
            Console.WriteLine("GUID: " + DirectoryBrowser.ObjectGUID);
            DirectoryBrowser.Dispose();

            Console.ReadLine();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer
United States United States
I'm a professional .NET software developer and proud military veteran. I've been in the software business for 20+ years now and if there's one lesson I have learned over the years, its that in this industry you have to be prepared to be humbled from time to time and never stop learning!

Comments and Discussions