SearchResult.Properties Property
Gets a ResultPropertyCollection collection of properties for this object.
Assembly: System.DirectoryServices (in System.DirectoryServices.dll)
Property Value
Type: System.DirectoryServices.ResultPropertyCollectionA ResultPropertyCollection of properties set on this object.
This collection only contains properties that were explicitly requested through DirectorySearcher.PropertiesToLoad.
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'. 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); } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.