O'Reilly logo

Professional C# 2005 by Allen Jones, Morgan Skinner, Karli Watson, Jay Glynn, Bill Evjen, Christian Nagel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 36. Windows Services

Windows Services are programs that can be started automatically at boot-time without the need of anyone logging on to the machine. After reading this chapter, you can modify the server processes from Chapter 29, ".NET Remoting," and Chapter 35, "Accessing the Internet," to be started automatically.

In the following pages, you learn:

  • The architecture of Windows Services; the functionality of a service program, service control program, and service configuration program.

  • How to implement a Windows Service with the classes found in the System.ServiceProcess namespace.

  • Installation programs to configure the Windows Service in the registry.

  • How to write a program to control the Windows Service using the ServiceController class.

  • How to implement event handling.

  • How to add event logging to other application types.

  • How to implement performance monitoring for a Windows Service.

The first section explains the function of a Windows Service. (You can download the code for this chapter from the Wrox Web site at www.wrox.com.)

What Is a Windows Service?

Windows Services are applications that can be automatically started when the operating system boots. They can run without having an interactive user logged on to the system. You can configure a Windows Service to be run from a specially configured user account; or from the system user account—a user account that has even more privileges than that of the system administrator.

Note

Windows Services don't run on Windows 95, 98, or ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required