WaitHandle.Handle Property

Definition

Caution

Use the SafeWaitHandle property instead.

Caution

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

Gets or sets the native operating system handle.

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

Property Value

IntPtr

An IntPtr representing the native operating system handle. The default is the value of the InvalidHandle field.

Attributes

Remarks

Assigning a new value to the Handle property does not close the previous handle. This can result in a leaked handle.

Do not use this property in the .NET Framework version 2.0 or later; use the SafeWaitHandle property instead. Setting this property to a valid handle also sets the SafeWaitHandle property, but setting it to InvalidHandle can result in a leaked handle.

Applies to

Product Versions (Obsolete)
.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)