DirectoryEntry.SchemaClassName DirectoryEntry.SchemaClassName DirectoryEntry.SchemaClassName DirectoryEntry.SchemaClassName Property

Definición

Obtiene el nombre de la clase de esquema para este objeto DirectoryEntry.Gets the name of the schema class for this DirectoryEntry object.

public:
 property System::String ^ SchemaClassName { System::String ^ get(); };
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSSchemaClassName")]
public string SchemaClassName { get; }
member this.SchemaClassName : string
Public ReadOnly Property SchemaClassName As String

Valor de propiedad

Nombre de la clase de esquema para este objeto DirectoryEntry.The name of the schema class for this DirectoryEntry object.

Ejemplos

En el ejemplo siguiente se muestra el SchemaClassName y SchemaEntry propiedades de la DirectoryEntry clase.The following example demonstrates the SchemaClassName and SchemaEntry properties of the DirectoryEntry class. En este ejemplo obtiene el especificado por el usuario DirectoryEntry y se obtienen todos sus elementos secundarios si el SchemaEntry es un objeto contenedor.This example gets the user-specified DirectoryEntry and gets all of its children if the SchemaEntry is a container object. El SchemaEntry es un objeto contenedor si el Name de ese objeto es "contenedor".The SchemaEntry is a container object if the Name of that object is "container".

Dim myADSPath As String = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com"  

' Creates an Instance of DirectoryEntry.  
Dim myDirectoryEntry As New DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword)  

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

' Gets the SchemaEntry of the ADS object.  
Dim mySchemaEntry As DirectoryEntry = myDirectoryEntry.SchemaEntry  

If String.Compare(mySchemaEntry.Name, "container") = 0 Then  
   Dim myChildDirectoryEntry As DirectoryEntry  
   For Each myChildDirectoryEntry In  myDirectoryEntry.Children  
      Console.WriteLine(myChildDirectoryEntry.Path)  
   Next  
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);  
}  
String^ myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";  

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

// Display the 'SchemaClassName'.  
Console::WriteLine("Schema class name:{0}", myDirectoryEntry->SchemaClassName);  

// Gets the SchemaEntry of the ADS Object.  
DirectoryEntry^ mySchemaEntry = myDirectoryEntry->SchemaEntry;  

if (!String::Compare(mySchemaEntry->Name, "container"))   
{  
    Collections::IEnumerator^ myEnum = myDirectoryEntry->Children->GetEnumerator();  
    while (myEnum->MoveNext())   
    {  
        DirectoryEntry^ myChildDirectoryEntry = safe_cast<DirectoryEntry^>(myEnum->Current);  
        Console::WriteLine(myChildDirectoryEntry->Path);  
    }  
}  

Comentarios

Esto es el mismo que el Name propiedad de la SchemaEntry propiedad.This is the same as the Name property of the SchemaEntry property.

Un DirectoryEntry esquema del objeto define sus propiedades y métodos.A DirectoryEntry object's schema defines its properties and methods.

Seguridad

DirectoryServicesPermission
Para obtener el nombre del esquema.To get the schema name.

Se aplica a

Consulte también: