共用方式為


DirectoryEntry.Guid 屬性

定義

取得 的 GUID DirectoryEntry為 。

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 代表 GUID DirectoryEntry的結構。

屬性

範例

以下範例展示了GuidDirectoryEntry類別的 和 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);

備註

在 Active Directory 網域服務中綁定物件時,請使用該 NativeGuid 屬性。

適用於

另請參閱