共用方式為


DirectoryEntry.NativeGuid 屬性

定義

取得 DirectoryEntry 的 GUID,這是提供者傳回的值。

public:
 property System::String ^ NativeGuid { System::String ^ get(); };
public string NativeGuid { get; }
[System.ComponentModel.Browsable(false)]
[System.DirectoryServices.DSDescription("DSNativeGuid")]
public string NativeGuid { get; }
member this.NativeGuid : string
[<System.ComponentModel.Browsable(false)>]
[<System.DirectoryServices.DSDescription("DSNativeGuid")>]
member this.NativeGuid : string
Public ReadOnly Property NativeGuid As String

屬性值

Guid 結構,表示 DirectoryEntry 的 GUID,這是提供者傳回的值。

屬性

範例

下列範例示範 Guid 類別的 DirectoryEntryNativeGuid 屬性。 這個範例會取得使用者指定的 DirectoryEntry ,並顯示其 GuidNativeGuid 屬性。

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請使用 屬性。

注意

輕量型目錄存取通訊協定 (LDAP) 提供者會以不同於 Internet Information Services (IIS) 、Novell NetWare Directory Server (NDS) 和 WinNT 提供者的格式傳回 的全域唯一標識符 DirectoryEntry

適用於

另請參閱