?
Solved

.Net windows service how to stop itself?

Posted on 2002-05-24
5
Medium Priority
?
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Accepted Solution

by:
Sector earned 100 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

770 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