DirectoryEntry.SchemaClassName Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan nama kelas skema untuk objek ini DirectoryEntry .
public:
property System::String ^ SchemaClassName { System::String ^ get(); };
public string SchemaClassName { get; }
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSSchemaClassName")]
public string SchemaClassName { get; }
member this.SchemaClassName : string
[<System.ComponentModel.Browsable(false)>]
[<System.DirectoryServices.DSDescription("DSSchemaClassName")>]
member this.SchemaClassName : string
Public ReadOnly Property SchemaClassName As String
Nilai Properti
Nama kelas skema untuk objek ini DirectoryEntry .
- Atribut
Contoh
Contoh berikut menunjukkan SchemaClassName properti dan SchemaEntry kelas DirectoryEntry . Contoh ini mendapatkan yang ditentukan DirectoryEntry pengguna dan mendapatkan semua turunannya jika SchemaEntry adalah objek kontainer. SchemaEntry adalah objek kontainer jika dari objek tersebut Name adalah "kontainer".
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);
}
}
Keterangan
Ini sama dengan Name properti SchemaEntry properti .
DirectoryEntry Skema objek mendefinisikan properti dan metodenya.