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