WaitHandle.Handle 屬性

定義

警告

Use the SafeWaitHandle property instead.

取得或設定原生 (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.")]
public virtual IntPtr Handle { get; set; }
public virtual IntPtr Handle { get; set; }
[System.Obsolete("Use the SafeWaitHandle property instead.")]
[set: System.Security.SecurityCritical]
public virtual IntPtr Handle { get; set; }
[<System.Obsolete("Use the SafeWaitHandle property instead.")>]
member this.Handle : nativeint with get, set
member this.Handle : nativeint with get, set
[<System.Obsolete("Use the SafeWaitHandle property instead.")>]
[<set: System.Security.SecurityCritical>]
member this.Handle : nativeint with get, set
Public Overridable Property Handle As IntPtr

屬性值

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.

適用於