Created
January 22, 2013 16:54
-
-
Save Andorbal/4596230 to your computer and use it in GitHub Desktop.
Basic service shell for running a Windows service from the console.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ServiceProcess; | |
namespace ServiceTest | |
{ | |
public partial class Service1 : ServiceBase | |
{ | |
public Service1() | |
{ | |
InitializeComponent(); | |
} | |
protected override void OnStart(string[] args) | |
{ | |
Start(); | |
} | |
protected override void OnStop() | |
{ | |
Finish(); | |
} | |
public void Start() | |
{ | |
// Normal start stuff | |
} | |
public void Finish() | |
{ | |
// Normal stop stuff | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment