DirectorySearcher.Asynchronous Egenskap

Definition

Hämtar eller anger ett värde som anger om sökningen utförs asynkront.

public:
 property bool Asynchronous { bool get(); void set(bool value); };
public bool Asynchronous { get; set; }
[System.DirectoryServices.DSDescription("DSAsynchronous")]
[System.Runtime.InteropServices.ComVisible(false)]
public bool Asynchronous { get; set; }
member this.Asynchronous : bool with get, set
[<System.DirectoryServices.DSDescription("DSAsynchronous")>]
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.Asynchronous : bool with get, set
Public Property Asynchronous As Boolean

Egenskapsvärde

true om sökningen är asynkron; false Annars.

Attribut

Exempel

I följande C#-exempel visas hur du skapar en asynkron sökning.

using System.DirectoryServices;
...
// Bind to the users container.
DirectoryEntry entry = new DirectoryEntry("LDAP://CN=users,DC=fabrikam,DC=com");
// Create a DirectorySearcher object.
DirectorySearcher src = new DirectorySearcher(entry);
//Set the Asynchronous property to true.
src.Asynchronous = true;
//Use the FindAll method to get search results.
SearchResultCollection res = src.FindAll();

Kommentarer

En asynkron sökning kan visa resultat när de hittas samtidigt som de söker efter ytterligare resultat. Detta är användbart för uppgifter som att fylla i listrutor.

Standardinställningen för den här egenskapen är false.

Gäller för