Solved

.Net windows service how to stop itself?

Posted on 2002-05-24
5
203 Views
Last Modified: 2012-05-04
I'm making my first windows service and I'm going back and doing some error coding where I want the service to actually stop itself.

I don't see any real methods for closing the service. I don't see any .close() or unload or anything like.

Could someone help me out here for how to let this guy stop gracefully? thanks.

=Timberbt
0
Comment
Question by:timberbt
5 Comments
 

Accepted Solution

by:
Sector earned 25 total points
ID: 7554811
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7818505
Hi timberbt,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Sector's comment(s) as an answer.

timberbt, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Author Comment

by:timberbt
ID: 7868018
Question was not really settle, so closing as unanswered is OK.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7870654
hi timberbt,
Thanks for returning to this old thread.  I disagree with your assessment.   Did you read the information at Sector's links?  There is excellent information there, including info about the System.ServiceProcess.ServiceController class that answers your question completely.  

Are you certain that you do not want to give Sector any credit?
0
 

Expert Comment

by:SpideyMod
ID: 7909936
Half points refunded.  Accepting Sector's answer.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now