Directory Binding : Bind « Directory Services « C# / CSharp Tutorial






using System;
using System.DirectoryServices;


public class MainClass
{
  public static int Main(string[] args)
  {
    DirectoryEntry MyDirectoryObject = new DirectoryEntry();
    
    MyDirectoryObject.Path = "LDAP://HMSRevenge/rootDSE";
    MyDirectoryObject.Username = @"userName\AAAA";
    MyDirectoryObject.Password = @"MyPassword";

    DirectoryEntries MyChildObjects = MyDirectoryObject.Children;

    return 0;  
  }
}








34.1.Bind
34.1.1.Directory Binding
34.1.2.Bind Object
34.1.3.Anonymous bind
34.1.4.Binding use a specified user
34.1.5.Simple Bind: Use ASCII