Share via


WindowsIdentity.Owner 屬性

定義

取得語彙基元擁有人的安全識別項 (SID)。

public:
 property System::Security::Principal::SecurityIdentifier ^ Owner { System::Security::Principal::SecurityIdentifier ^ get(); };
public System.Security.Principal.SecurityIdentifier Owner { get; }
public System.Security.Principal.SecurityIdentifier? Owner { get; }
[System.Runtime.InteropServices.ComVisible(false)]
public System.Security.Principal.SecurityIdentifier Owner { get; }
member this.Owner : System.Security.Principal.SecurityIdentifier
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.Owner : System.Security.Principal.SecurityIdentifier
Public ReadOnly Property Owner As SecurityIdentifier

屬性值

語彙基元擁有人的物件。

屬性

範例

下列程式代碼範例示範如何使用 Owner 屬性來顯示令牌擁有者的安全性標識碼。 此程式代碼範例是針對 類別提供的較大範例的 WindowsIdentity 一部分

// Display the SID for the owner.
Console.Write("The SID for the owner is : ");
SecurityIdentifier si = windowsIdentity.Owner;
Console.WriteLine(si.ToString());
' Display the SID for the owner.
Console.Write("The SID for the owner is : ")
Dim si As SecurityIdentifier
si = windowsIdentity.Owner
Console.WriteLine(si.ToString())

備註

SID 可唯一識別所有 Windows NT 實作上的使用者或群組。 傳回的 SID 會識別將套用至新建立對象的預設擁有者 SID。

適用於