DirectoryEntry.Children : DirectoryEntry « System.DirectoryServices « C# / C Sharp by API






DirectoryEntry.Children

  


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 = @"AAA\BBB";
    MyDirectoryObject.Password = @"MyPassword";
    MyDirectoryObject.UsePropertyCache = false;

    DirectoryEntries MyChildObjects = MyDirectoryObject.Children;
        
    PropertyCollection MyAttributes = MyDirectoryObject.Properties;
    foreach(string MyAttributeName in MyAttributes.PropertyNames)
    {
      PropertyValueCollection MyAttributeValues = MyAttributes[MyAttributeName];
      foreach(string MyValue in MyAttributeValues)
      {
        Console.WriteLine(MyAttributeName + " = " + MyValue);
      }
    }

    return 0;
  }
}

   
    
  








Related examples in the same category

1.new DirectoryEntry()
2.new DirectoryEntry(String connection)
3.DirectoryEntry.Close()
4.DirectoryEntry.CommitChanges()
5.DirectoryEntry.DeleteTree()
6.DirectoryEntry.Password
7.DirectoryEntry.Path
8.DirectoryEntry.Properties
9.DirectoryEntry.Rename(String newName)
10.DirectoryEntry.Username