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

適用於