SecurityIdentifier 類別

定義

代表安全識別項 (SID),並為 SID 提供封送處理 (Marshaling) 和比較作業。Represents a security identifier (SID) and provides marshaling and comparison operations for SIDs.

public ref class SecurityIdentifier sealed : System::Security::Principal::IdentityReference, IComparable<System::Security::Principal::SecurityIdentifier ^>
[System.Runtime.InteropServices.ComVisible(false)]
public sealed class SecurityIdentifier : System.Security.Principal.IdentityReference, IComparable<System.Security.Principal.SecurityIdentifier>
type SecurityIdentifier = class
    inherit IdentityReference
    interface IComparable<SecurityIdentifier>
Public NotInheritable Class SecurityIdentifier
Inherits IdentityReference
Implements IComparable(Of SecurityIdentifier)
繼承
SecurityIdentifier
屬性
實作

建構函式

SecurityIdentifier(Byte[], Int32)

使用指定的安全識別項 (SID) 二進位表示,初始化 SecurityIdentifier 類別的新執行個體。Initializes a new instance of the SecurityIdentifier class by using a specified binary representation of a security identifier (SID).

SecurityIdentifier(IntPtr)

使用表示安全識別項 (SID) 之二進位格式的整數,初始化 SecurityIdentifier 類別的新執行個體。Initializes a new instance of the SecurityIdentifier class by using an integer that represents the binary form of a security identifier (SID).

SecurityIdentifier(String)

使用安全性描述元定義語言 (SDDL) 格式的指定安全識別項 (SID),初始化 SecurityIdentifier 類別的新執行個體。Initializes a new instance of the SecurityIdentifier class by using the specified security identifier (SID) in Security Descriptor Definition Language (SDDL) format.

SecurityIdentifier(WellKnownSidType, SecurityIdentifier)

使用指定的已知安全識別項 (SID) 型別和網域 SID,初始化 SecurityIdentifier 類別的新執行個體。Initializes a new instance of the SecurityIdentifier class by using the specified well known security identifier (SID) type and domain SID.

欄位

MaxBinaryLength

傳回安全識別項之二進位表示的最大值,以位元組為單位。Returns the maximum size, in bytes, of the binary representation of the security identifier.

MinBinaryLength

傳回安全識別項之二進位表示的最小值,以位元組為單位。Returns the minimum size, in bytes, of the binary representation of the security identifier.

屬性

AccountDomainSid

如果 SID 代表 Windows 帳戶 SID,則傳回 SecurityIdentifier 物件所表示的 SID 之帳戶網域安全識別項 (SID) 部分。Returns the account domain security identifier (SID) portion from the SID represented by the SecurityIdentifier object if the SID represents a Windows account SID. 如果 SID 不代表 Windows 帳戶 SID,則這個屬性會傳回 nullIf the SID does not represent a Windows account SID, this property returns null.

BinaryLength

傳回 SecurityIdentifier 物件所表示的安全識別項 (SID) 之長度,以位元組為單位。Returns the length, in bytes, of the security identifier (SID) represented by the SecurityIdentifier object.

Value

傳回這個 SecurityIdentifier 物件所表示的安全識別項 (SID) 之大寫安全性描述元定義語言 (SDDL) 字串。Returns an uppercase Security Descriptor Definition Language (SDDL) string for the security identifier (SID) represented by this SecurityIdentifier object.

方法

CompareTo(SecurityIdentifier)

將目前的 SecurityIdentifier 物件與指定的 SecurityIdentifier 物件相比較。Compares the current SecurityIdentifier object with the specified SecurityIdentifier object.

Equals(Object)

傳回值,指出這個 SecurityIdentifier 物件是否等於指定的物件。Returns a value that indicates whether this SecurityIdentifier object is equal to a specified object.

Equals(SecurityIdentifier)

指出指定的 SecurityIdentifier 物件是否等於目前的 SecurityIdentifier 物件。Indicates whether the specified SecurityIdentifier object is equal to the current SecurityIdentifier object.

GetBinaryForm(Byte[], Int32)

SecurityIdentifier 類別所表示的指定安全識別項 (SID) 之二進位表示,複製到位元組陣列。Copies the binary representation of the specified security identifier (SID) represented by the SecurityIdentifier class to a byte array.

GetHashCode()

做為目前 SecurityIdentifier 物件的雜湊函式。Serves as a hash function for the current SecurityIdentifier object. GetHashCode() 方法適用於雜湊演算法和雜湊資料表這類的資料結構。The GetHashCode() method is suitable for hashing algorithms and data structures like a hash table.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IsAccountSid()

傳回值,指出這個 SecurityIdentifier 物件所表示的安全識別項 (SID) 是否為有效的 Windows 帳戶 SID。Returns a value that indicates whether the security identifier (SID) represented by this SecurityIdentifier object is a valid Windows account SID.

IsEqualDomainSid(SecurityIdentifier)

傳回值,指出這個 SecurityIdentifier 物件所表示的安全識別項 (SID) 是否與指定的 SID 來自相同網域。Returns a value that indicates whether the security identifier (SID) represented by this SecurityIdentifier object is from the same domain as the specified SID.

IsValidTargetType(Type)

傳回值,指出指定型別是否為 SecurityIdentifier 類別的有效轉譯型別。Returns a value that indicates whether the specified type is a valid translation type for the SecurityIdentifier class.

IsWellKnown(WellKnownSidType)

傳回值,指出 SecurityIdentifier 物件是否符合指定的已知安全識別項 (SID) 型別。Returns a value that indicates whether the SecurityIdentifier object matches the specified well known security identifier (SID) type.

MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

以安全性描述元定義語言 (SDDL) 格式,傳回 SecurityIdentifier 物件所表示的帳戶之安全識別項 (SID)。Returns the security identifier (SID), in Security Descriptor Definition Language (SDDL) format, for the account represented by the SecurityIdentifier object. SDDL 格式範例為 S-1-5-9。An example of the SDDL format is S-1-5-9.

Translate(Type)

SecurityIdentifier 物件所表示的帳戶名稱轉譯為另一個 IdentityReference 衍生型別。Translates the account name represented by the SecurityIdentifier object into another IdentityReference-derived type.

運算子

Equality(SecurityIdentifier, SecurityIdentifier)

比較兩個 SecurityIdentifier 物件,判斷它們是否相等。Compares two SecurityIdentifier objects to determine whether they are equal. 如果它們的正式名稱表示與 Value 屬性所傳回的相同,或兩者都是 null,則會將它們視為相等。They are considered equal if they have the same canonical representation as the one returned by the Value property or if they are both null.

Inequality(SecurityIdentifier, SecurityIdentifier)

比較兩個 SecurityIdentifier 物件,判斷它們是否不相等。Compares two SecurityIdentifier objects to determine whether they are not equal. 如果它們的正式名稱表示與 Value 屬性所傳回的不同,或其中一個物件為 null 而另一個不是,則會將它們視為不相等。They are considered not equal if they have different canonical name representations than the one returned by the Value property or if one of the objects is null and the other is not.

適用於