SearchResult.Properties 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 a ResultPropertyCollection collection of properties for this object.
public:
property System::DirectoryServices::ResultPropertyCollection ^ Properties { System::DirectoryServices::ResultPropertyCollection ^ get(); };
public System.DirectoryServices.ResultPropertyCollection Properties { get; }
member this.Properties : System.DirectoryServices.ResultPropertyCollection
Public ReadOnly Property Properties As ResultPropertyCollection
Property Value
A ResultPropertyCollection of properties set on this object.
Examples
The following example is an excerpt of the example in SearchResult. The original example creates a new DirectoryEntry object with the desired path and uses the FindOne method to initiate the search. After performing the search, the example uses the GetDirectoryEntry method to retrieve the live directory entry that is identified in the search results.
In this example, the search result is put into a ResultPropertyCollection. Then, each property is displayed to the console window.
' Get the properties for 'mySearchResult'.
Dim myResultPropColl As ResultPropertyCollection
myResultPropColl = mySearchResult.Properties
Console.WriteLine("The properties of the 'mySearchResult' are :")
Dim myKey As String
For Each myKey In myResultPropColl.PropertyNames
Dim tab1 As String = " "
Console.WriteLine(myKey + " = ")
Dim myCollection As Object
For Each myCollection In myResultPropColl(myKey)
Console.WriteLine(tab1 + myCollection)
Next myCollection
Next myKey
// Get the properties for 'mySearchResult'.
ResultPropertyCollection myResultPropColl;
myResultPropColl = mySearchResult.Properties;
Console.WriteLine("The properties of the " +
"'mySearchResult' are :");
foreach( string myKey in myResultPropColl.PropertyNames)
{
string tab = " ";
Console.WriteLine(myKey + " = ");
foreach( Object myCollection in myResultPropColl[myKey])
{
Console.WriteLine(tab + myCollection);
}
}
// Get the properties for 'mySearchResult'.
ResultPropertyCollection^ myResultPropColl = mySearchResult->Properties;
Console::WriteLine("The properties of the 'mySearchResult' are :");
IEnumerator^ myEnum = myResultPropColl->PropertyNames->GetEnumerator();
while (myEnum->MoveNext())
{
String^ myKey = safe_cast<String^>(myEnum->Current);
Console::WriteLine("{0} = ", myKey);
IEnumerator^ myEnum = myResultPropColl->Item[myKey]->GetEnumerator();
while (myEnum->MoveNext())
{
Console::WriteLine("\t{0}", myEnum->Current);
}
}
Remarks
This collection only contains properties that were explicitly requested through DirectorySearcher.PropertiesToLoad.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기