共用方式為


DirectorySearcher.DerefAlias 屬性

定義

取得或設定值,指出如何解析搜尋期間找到之物件的別名。

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

屬性值

DereferenceAlias 值,指定解除參考別名的行為。 這個屬性的預設設定為 Never

屬性

範例

下列 C# 範例示範如何將 屬性設定 DerefAliasAlways ,以便在搜尋次級和尋找基底物件時取值別名。

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

適用於

另請參閱