Skip to content

Instantly share code, notes, and snippets.

@snmslavk
Last active July 14, 2017 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snmslavk/ccb798aabe9f6b7a44717931426d4e61 to your computer and use it in GitHub Desktop.
Save snmslavk/ccb798aabe9f6b7a44717931426d4e61 to your computer and use it in GitHub Desktop.
using System;
using System.ServiceProcess;
namespace WindowsService1
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
System.IO.File.AppendAllText("/tmp/logservice1.txt","starting...");
}
protected override void OnStop()
{
System.IO.File.AppendAllText("/tmp/logservice1.txt","stopping....");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment