WaitHandle.Handle 属性

定义

注意

Use the SafeWaitHandle property instead.

注意

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

获取或设置本机操作系统句柄。

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)