SafeHandle.IsClosed 屬性

定義

取得值,指出控制代碼是否已關閉。Gets a value indicating whether the handle is closed.

public:
 property bool IsClosed { bool get(); };
public bool IsClosed { get; }
member this.IsClosed : bool
Public ReadOnly Property IsClosed As Boolean

屬性值

Boolean

如果控制代碼已關閉,則為 true,否則為 falsetrue if the handle is closed; otherwise, false.

備註

IsClosed方法會傳回值,指出 SafeHandle 物件的控制碼是否不再與原生資源相關聯。The IsClosed method returns a value indicating whether the SafeHandle object's handle is no longer associated with a native resource. 這與屬性的定義不同 IsInvalid ,它會計算給定的控制碼是否一律視為無效。This differs from the definition of the IsInvalid property, which computes whether a given handle is always considered invalid. IsClosed 下列情況下,方法會傳回 true 值:The IsClosed method returns a true value in the following cases:

適用於