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.

安全性

SecurityPermission
用於存取未受管理的程式碼。for access to unmanaged code. 關聯的列舉型別:UnmanagedCodeAssociated enumeration: UnmanagedCode.

適用於