UtilServicingSetStatus(ServiceController, ServiceStatus, Boolean, Boolean) Method
Sets the status of a service.
Namespace: DevCase.Core.Windows.ServicingAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static void SetStatus(
ServiceController svc,
ServiceStatus status,
bool wait = false,
bool throwOnStatusMissmatch = false
)
Public Shared Sub SetStatus (
svc As ServiceController,
status As ServiceStatus,
Optional wait As Boolean = false,
Optional throwOnStatusMissmatch As Boolean = false
)
Dim svc As ServiceController
Dim status As ServiceStatus
Dim wait As Boolean
Dim throwOnStatusMissmatch As Boolean
UtilServicing.SetStatus(svc, status, wait,
throwOnStatusMissmatch)
public:
static void SetStatus(
ServiceController^ svc,
ServiceStatus status,
bool wait = false,
bool throwOnStatusMissmatch = false
)
static member SetStatus :
svc : ServiceController *
status : ServiceStatus *
?wait : bool *
?throwOnStatusMissmatch : bool
(* Defaults:
let _wait = defaultArg wait false
let _throwOnStatusMissmatch = defaultArg throwOnStatusMissmatch false
*)
-> unit
No code example is currently available or this language may not be supported.
Parameters
- svc ServiceController
-
The service.
- status ServiceStatus
-
The target service status.
- wait Boolean (Optional)
-
if set to waits for the status change completition.
- throwOnStatusMissmatch Boolean (Optional)
-
If set to , throws an error when attempting to start a service that is started,
or attempting to stop a service that is stopped.