WaitHandle.Handle 屬性

定義

警告

Use the SafeWaitHandle property instead.

警告

WaitHandle.Handle has been deprecated. Use the SafeWaitHandle property instead.

取得或設定原生 (Native) 的作業系統控制代碼。

C#
[System.Obsolete("Use the SafeWaitHandle property instead.")]
public virtual IntPtr Handle { get; set; }
C#
[System.Obsolete("WaitHandle.Handle has been deprecated. Use the SafeWaitHandle property instead.")]
public virtual IntPtr Handle { get; set; }
C#
[System.Obsolete("Use the SafeWaitHandle property instead.")]
public virtual IntPtr Handle { get; [System.Security.SecurityCritical] set; }
C#
public virtual IntPtr Handle { get; set; }

屬性值

IntPtr

IntPtr,代表原生作業系統控制代碼。 預設為 InvalidHandle 欄位的值。

屬性

備註

將新值指派給 Handle 屬性並不會關閉先前的控制碼。 這可能會導致控制碼外泄。

請勿在 .NET Framework 2.0 版或更新版本中使用此屬性;請改用 SafeWaitHandle 屬性。 將此屬性設定為有效的控制碼也會設定 SafeWaitHandle 屬性,但將它設定為 InvalidHandle 可能會導致控制碼外泄。

適用於

產品 版本 (已過時)
.NET (Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9)
.NET Framework 1.1 (2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1)
.NET Standard (2.0, 2.1)