Stopping vb services

  • Thread starter Thread starter Jm
  • Start date Start date
J

Jm

Hi All

Is there a better way to stopping a vb service rather than just saying end
in your code ?
 
Jm said:
Hi All

Is there a better way to stopping a vb service rather than just saying end
in your code ?

This works for me:

Dim thisService as new ServiceController("insert name of this service as it
appears in services list")
thisService.Stop()

Make sure you have any necessary cleanup code in OnStop()...

Regards

--Jim.
 
Jim,

Can I call .Stop() from the OnStart of my service? I would think so but I
would like some clarification...

Thanks!

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

service monitoring 3
Windows 7 Problem with Services 4
Novice VB Question 36
Resume watching TV after notification on Amazon Fire Cube? 0
Debug Output 3
Overriding the Timer.Stop() Method 2
Windows Service 7
thread pool services 1

Back
Top