Solved

.Net windows service how to stop itself?

Posted on 2002-05-24
5
202 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Share codes 68 114
VBA to format 3 79
Access 2013 combo box not working 3 25
How to compare ms sql hashbytes results within vb6 5 37
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

707 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

20 Experts available now in Live!

Get 1:1 Help Now