DirectoryEntry.SchemaClassName Property

Definition

Gets the name of the schema class for this DirectoryEntry object.

C#
public string SchemaClassName { get; }
C#
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSSchemaClassName")]
public string SchemaClassName { get; }

Property Value

The name of the schema class for this DirectoryEntry object.

Attributes

Examples

The following example demonstrates the SchemaClassName and SchemaEntry properties of the DirectoryEntry class. This example gets the user-specified DirectoryEntry and gets all of its children if the SchemaEntry is a container object. The SchemaEntry is a container object if the Name of that object is "container".

C#
String myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";

// Creates an Instance of DirectoryEntry.
DirectoryEntry  myDirectoryEntry=new DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword);

// Display the 'SchemaClassName'.
Console.WriteLine("Schema class name:" + myDirectoryEntry.SchemaClassName);

// Gets the SchemaEntry of the ADS object.
DirectoryEntry mySchemaEntry = myDirectoryEntry.SchemaEntry;

if (string.Compare(mySchemaEntry.Name, "container") == 0)
{
   foreach(DirectoryEntry myChildDirectoryEntry in myDirectoryEntry.Children)
      Console.WriteLine(myChildDirectoryEntry.Path);
}

Remarks

This is the same as the Name property of the SchemaEntry property.

A DirectoryEntry object's schema defines its properties and methods.

Applies to

Proizvod Verzije
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also