DirectorySearcher.DerefAlias 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,指出如何解析搜尋期間找到之物件的別名。
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# 範例示範如何將 屬性設定 DerefAlias 為 Always ,以便在搜尋次級和尋找基底物件時取值別名。
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();