DirectoryEntry.SchemaClassName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the name of the schema class for this DirectoryEntry object.
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
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".
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);
}
}
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
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기