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# 示例演示如何将 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();  

适用于

另请参阅