user57175
user57175

Reputation: 3434

What is the best way of working with Services in a VB.NET application?

I'm using VB 9 (VS2008).

I would like to know how to do the control Windows Services through an Windows Forms application.

I want to know:

  1. How to determine the status of a service?
  2. How to change the Startup type of the service?
  3. How to start, stop, pause and resume a service?

Thank you!

Upvotes: 0

Views: 144

Answers (2)

Joe
Joe

Reputation: 42607

I'm pretty sure that (unless they changed stuff recently) you'll have to do this either through p/invoke's or through WMI.

Wow, how did I forget about that class.

Upvotes: 0

Matt Brunell
Matt Brunell

Reputation: 10389

The framework class ServiceController allows you to do all of these things.

Upvotes: 4

Related Questions