
This class handles installation of a Windows Service as well as providing the ability to start stop and detect the state of a Windows Service. Utilizes P/Invoke calls to install the service.
Westwind.WebMonitor.Components.WindowsServiceManager
public class WindowsServiceManager : object
Class Members
Member | Description | |
---|---|---|
![]() |
Constructor |
|
![]() |
CloseServiceHandle |
public static void CloseServiceHandle( IntPtr SCHANDLE ); |
![]() |
CreateService |
public static IntPtr CreateService( IntPtr SC_HANDLE, |
![]() |
DeleteService |
public static int DeleteService( IntPtr SVHANDLE ); |
![]() |
GetLastError |
public static int GetLastError(); |
![]() |
InstallService |
This method installs and runs the service in the service conrol manager. public bool InstallService( string svcPath, |
![]() |
IsServiceInstalled |
Determines whether a service exisits. Pass in the Service Name either by the ServiceName or the descriptive name public bool IsServiceInstalled( string ServiceName ); |
![]() |
IsServiceRunning |
public bool IsServiceRunning( string ServiceName ); |
![]() |
OpenSCManager |
public static IntPtr OpenSCManager( string lpMachineName, |
![]() |
OpenService |
public static IntPtr OpenService( IntPtr SCHANDLE, |
![]() |
StartService |
public static int StartService( IntPtr SVHANDLE, public bool StartService( string ServiceName ); |
![]() |
StopService |
Stops a service by name or descriptive name public bool StopService( string ServiceName ); |
![]() |
UnInstallService |
This method uninstalls the service from the service conrol manager. public bool UnInstallService( string svcName ); |
Requirements
Namespace: Westwind.WebMonitor.ComponentsAssembly: webmonitorcomponents.dll
© West Wind Technologies, 2018 • Updated: 12/28/06
Comment or report problem with topic