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

属性值

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。

适用于