Επεξεργασία

Κοινή χρήση μέσω


ServiceController.Continue Method

Definition

Continues a service after it has been paused.

public:
 void Continue();
public void Continue ();
member this.Continue : unit -> unit
Public Sub Continue ()

Exceptions

An error occurred when accessing a system API.

The service was not found.

Examples

The following example demonstrates the use of the Continue method to continue a paused service. This example is part of a larger example that is provided for the ServiceController class.

sc.Continue();
while (sc.Status == ServiceControllerStatus.Paused)
{
    Thread.Sleep(1000);
    sc.Refresh();
}
Console.WriteLine("Status = " + sc.Status);
sc.Continue()
While sc.Status = ServiceControllerStatus.Paused
    Thread.Sleep(1000)
    sc.Refresh()
End While
Console.WriteLine("Status = " + sc.Status.ToString())

Remarks

When you call Continue for a service, its status is first changed to ContinuePending and then, when the Continue method returns, it is changed to Running.

You cannot call Continue for the service until the service controller status is Paused.

Applies to

See also