WaitHandle.Handle WaitHandle.Handle WaitHandle.Handle WaitHandle.Handle Property

定義

警告

此 API 現已淘汰。

取得或設定原生 (Native) 的作業系統控制代碼。Gets or sets the native operating system handle.

public:
 virtual property IntPtr Handle { IntPtr get(); void set(IntPtr value); };
[System.Obsolete("Use the SafeWaitHandle property instead.")]
[set: System.Security.SecurityCritical]
public virtual IntPtr Handle { get; set; }
member this.Handle : nativeint with get, set
Public Overridable Property Handle As IntPtr

屬性值

IntPtr,代表原生作業系統控制代碼。An IntPtr representing the native operating system handle. 預設為 InvalidHandle 欄位的值。The default is the value of the InvalidHandle field.

備註

指派新值給Handle屬性不會關閉先前的控制代碼。Assigning a new value to the Handle property does not close the previous handle. 這會導致遺漏的控制代碼。This can result in a leaked handle.

請勿使用這個屬性在.NET Framework 2.0 版或更新版本;使用SafeWaitHandle屬性改為。Do not use this property in the .NET Framework version 2.0 or later; use the SafeWaitHandle property instead. 此屬性設定為有效的控制代碼也設定SafeWaitHandle屬性,但將它設定為InvalidHandle可能會導致遺漏的控制代碼。Setting this property to a valid handle also sets the SafeWaitHandle property, but setting it to InvalidHandle can result in a leaked handle.

安全性

SecurityCriticalAttribute
需要完全信任立即呼叫者,來設定屬性值。Requires full trust for the immediate caller to set the property value. 這個成員無法由部分信任或不透明的程式碼設定。This member cannot be set by partially trusted or transparent code.

InheritanceDemand
在衍生的型別必須具有UnmanagedCode來設定屬性值。Derived types must have UnmanagedCode to set the property value.

適用於