By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

Stopping vb services

P: n/a
Jm
Hi All

Is there a better way to stopping a vb service rather than just saying end
in your code ?
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
How about having a service controller in your code to call as stop on your
service when needed?

Rgds,
Anand
http://www.dotnetindia.com

"Jm" wrote:
Hi All

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

Nov 21 '05 #2

P: n/a
Jim
"Jm" <ja*****@ihug.com.au> wrote in message
news:cp**********@lust.ihug.co.nz...
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.
Nov 21 '05 #3

P: n/a
Jim,

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

Thanks!

Scott

"Jim" wrote:
"Jm" <ja*****@ihug.com.au> wrote in message
news:cp**********@lust.ihug.co.nz...
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.

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.