C# Class DevUtils.Service.ServiceUtils

The ServiceUtils type provides an implementation of the IServiceUtils interface that provides utility methods for managing Windows services.

Base project reference: https://github.com/cjaehnen/OpenLib.Utils

Inheritance: IServiceUtils
Afficher le fichier Open project: jornfilho/.net-Dev-Utils Class Usage Examples

Private Properties

Свойство Type Description
CreateProcessInfo System.Diagnostics.ProcessStartInfo

Méthodes publiques

Méthode Description
ChangeServiceState ( string host, string serviceName, WindowsServiceAction action ) : bool

Changes the state of the specified Windows service using the specified action.

GetServiceState ( string host, string serviceName ) : WindowsServiceState

Gets the state of the specified Windows service on the specified host.

ServiceUtils ( ) : System

Creates a new instance of the ServiceUtils class.

ServiceUtils ( IProcessUtils processUtils ) : System

Creates a new instance of the ServiceUtils class.

Private Methods

Méthode Description
CreateProcessInfo ( string processArgs ) : ProcessStartInfo

Creates a ProcessStartInfo object using the specified process arguments.

Method Details

ChangeServiceState() public méthode

Changes the state of the specified Windows service using the specified action.
public ChangeServiceState ( string host, string serviceName, WindowsServiceAction action ) : bool
host string The name of the host to connect to where the Windows service resides.
serviceName string The name of the Windows service.
action WindowsServiceAction The action in which to perform on the Windows service.
Résultat bool

GetServiceState() public méthode

Gets the state of the specified Windows service on the specified host.
public GetServiceState ( string host, string serviceName ) : WindowsServiceState
host string The name of the host to connect to where the Windows service resides.
serviceName string The name of the Windows service.
Résultat WindowsServiceState

ServiceUtils() public méthode

Creates a new instance of the ServiceUtils class.
public ServiceUtils ( ) : System
Résultat System

ServiceUtils() public méthode

Creates a new instance of the ServiceUtils class.
public ServiceUtils ( IProcessUtils processUtils ) : System
processUtils IProcessUtils A reference to the IProcessUtils for managing processes.
Résultat System