Monday, March 28, 2011

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!

From stackoverflow
  • 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.

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

    : You didn't mention anything about how to change the start up type...

0 comments:

Post a Comment