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。

适用于