語言

DirectorySearcher.Asynchronous 屬性

定義

取得或設定值,這個值表示是否以異步方式執行搜尋。

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

屬性值

true 若搜尋為非同步; false 否則,

屬性

範例

以下 C# 範例說明如何建立非同步搜尋。

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();

備註

非同步搜尋可以在搜尋額外結果的同時,顯示結果的即時發現。 這對於填寫清單框等任務非常有用。

此屬性的預設設定為 false。

適用於