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 屬性。