C# Class WebApplications.Utilities.Service.Common.Control.Controller

Handles manipulation of services.
Exibir arquivo Open project: webappsuk/CoreLibraries

Public Methods

Method Description
GetServiceStatus ( [ serviceName ) : ServiceControllerStatus

Gets the service status.

Install ( [ serviceName, [ displayName, [ description, [ fileName, [ userName = null, [ password = null ) : void

Installs the specified service name.

ServiceIsInstalled ( [ serviceName ) : bool

Whether the specified service is installed.

Private Methods

Method Description
ChangeServiceConfig2 ( IntPtr hService, ServiceConfig dwInfoLevel, SERVICE_DESCRIPTION &lpInfo ) : bool
CloseServiceHandle ( IntPtr hSCObject ) : bool
CommandService ( [ serviceName, int command, CancellationToken token = default(CancellationToken) ) : Task
ContinueService ( [ serviceName, CancellationToken token = default(CancellationToken) ) : Task
CreateService ( IntPtr hSCManager, string lpServiceName, string lpDisplayName, ServiceAccessRights dwDesiredAccess, int dwServiceType, ServiceBootFlag dwStartType, ServiceError dwErrorControl, string lpBinaryPathName, string lpLoadOrderGroup, IntPtr lpdwTagId, string lpDependencies, string lp, string lpPassword ) : IntPtr
DeleteService ( IntPtr hService ) : bool
OpenSCManager ( ScmAccessRights rights ) : IntPtr

Opens the sc manager.

OpenSCManager ( string machineName, string databaseName, ScmAccessRights dwDesiredAccess ) : IntPtr
OpenService ( IntPtr hSCManager, string lpServiceName, ServiceAccessRights dwDesiredAccess ) : IntPtr
PauseService ( [ serviceName, CancellationToken token = default(CancellationToken) ) : Task
StartService ( [ serviceName, [ args = null, CancellationToken token = default(CancellationToken) ) : Task
StopService ( [ serviceName, CancellationToken token = default(CancellationToken) ) : Task
Uninstall ( [ serviceName, CancellationToken token = default(CancellationToken) ) : Task
WaitForAsync ( [ serviceController, ServiceControllerStatus status, CancellationToken token = default(CancellationToken) ) : Task

Method Details

GetServiceStatus() public static method

Gets the service status.
public static GetServiceStatus ( [ serviceName ) : ServiceControllerStatus
serviceName [ Name of the service.
return ServiceControllerStatus

Install() public static method

Installs the specified service name.
///
public static Install ( [ serviceName, [ displayName, [ description, [ fileName, [ userName = null, [ password = null ) : void
serviceName [ Name of the service.
displayName [ The display name.
description [ The description.
fileName [ Name of the file.
userName [ Name of the user.
password [ The password.
return void

ServiceIsInstalled() public static method

Whether the specified service is installed.
public static ServiceIsInstalled ( [ serviceName ) : bool
serviceName [ Name of the service.
return bool