DirectoryEntry.Guid 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取 DirectoryEntry 的 GUID。
public:
property Guid Guid { Guid get(); };
public Guid Guid { get; }
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSGuid")]
public Guid Guid { get; }
member this.Guid : Guid
[<System.ComponentModel.Browsable(false)>]
[<System.DirectoryServices.DSDescription("DSGuid")>]
member this.Guid : Guid
Public ReadOnly Property Guid As Guid
属性值
一个 Guid 结构,表示 DirectoryEntry 的 GUID。
- 属性
示例
以下示例演示 Guid 类的 DirectoryEntry 和 NativeGuid 属性。 此示例获取用户指定的 DirectoryEntry 并显示其 Guid 和 NativeGuid 属性。
Dim myADSPath As [String] = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com"
Dim myDirectoryEntry As New DirectoryEntry(myADSPath)
' Display the Guid and NativeGuid.
Console.WriteLine("The GUID of the ADS object:" + myDirectoryEntry.Guid.ToString)
Console.WriteLine("The Native GUID of the ADS" + "object:" + myDirectoryEntry.NativeGuid)
String myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";
DirectoryEntry myDirectoryEntry=new DirectoryEntry(myADSPath);
// Display the Guid and NativeGuid.
Console.WriteLine("The GUID of the ADS object:"+
myDirectoryEntry.Guid);
Console.WriteLine("The Native GUID of the ADS"+
"object:"+myDirectoryEntry.NativeGuid);
String^ myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";
DirectoryEntry^ myDirectoryEntry = gcnew DirectoryEntry(myADSPath);
// Display the Guid and NativeGuid.
Console::WriteLine("The GUID of the ADS object: {0}", myDirectoryEntry->Guid);
Console::WriteLine("The Native GUID of the ADS object: {0}",
myDirectoryEntry->NativeGuid);
注解
绑定到 Active Directory 域服务 中的对象时,请使用 NativeGuid 属性。