Wednesday, October 30, 2013

Creating a Basic Windows Service

Microsoft Windows Services, enable us to create long-running executable applications that run in their own Windows sessions. These services can be automatically started when the computer boots, can be paused and restarted, and do not show any user interface.

Visual Studio.Net provides us pre-defined templates which can be used to create Windows Services, in the following example we shall see on how to create a basic windows service.

1.    Open VS.Net
2.    Create a new project of type Windows Service

3.    I will name my service as Notification Service
4.    Select a location to save the project and click OK.
5.    A new service gets created, rename the service accordingly, I have named the service as Notification Service.

6.    Switch to the code view, notice that the basic OnStart and OnStop methods are already defined.

7. We can override these OnStart and OnStop methods to define the service implementation.

Search Flipkart Products:

No comments: