ServiceBase.ServiceHandle 属性
定义
获取服务的服务控制句柄。Gets the service control handle for the service.
protected:
property IntPtr ServiceHandle { IntPtr get(); };
protected IntPtr ServiceHandle { get; }
member this.ServiceHandle : nativeint
Protected ReadOnly Property ServiceHandle As IntPtr
属性值
一个 IntPtr 结构,包含服务的服务控制句柄。An IntPtr structure that contains the service control handle for the service.
注解
服务控制句柄用于与服务控制管理器 (SCM) 通信。The service control handle is used to communicate with the Service Control Manager (SCM). 该句柄可用于使用非托管函数为调用服务更新服务控制管理器的状态信息 SetServiceStatus 。The handle can be used to update the service control manager's status information for the calling service using the unmanaged SetServiceStatus function.