15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

668 ❘ ChaPTer 25 windOws services<br />

Here are a few examples of services:<br />

➤<br />

➤<br />

➤<br />

➤<br />

Simple TCP/IP Services is a service program that hosts some small TCP/IP servers: echo, daytime,<br />

quote, <strong>and</strong> others.<br />

World Wide Web Publishing Service is the service of the Internet Information Server (IIS).<br />

Event Log is a service to log messages to the event log system.<br />

Windows Search is a service that creates indexes of data on the disk.<br />

You can use the Services administration tool, shown in Figure 25-1, to see all the services on a system.<br />

This program can be found with the Administrative Tools.<br />

figure 25-1<br />

WindoWs serViCes arChiTeCTure<br />

Three program types are necessary to operate a Windows Service:<br />

➤<br />

➤<br />

➤<br />

A service program<br />

A service control program<br />

A service configuration program<br />

The service program itself provides the actual functionality you are looking for. With a service control<br />

program, it is possible to send control requests to a service, such as start, stop, pause, <strong>and</strong> continue. With a<br />

service configuration program, a service can be installed; it is copied to the file system, written into the registry,<br />

<strong>and</strong> configured as a service. Although .<strong>NET</strong> components can be installed simply with an xcopy — because they<br />

don’t need to write information to the registry — installation for services requires registry configuration. A<br />

service configuration program can also be used to change the configuration of that service at a later point.<br />

These three ingredients of a Windows Service are discussed in the following subsections.<br />

service Program<br />

Before looking at the .<strong>NET</strong> implementation of a service, let’s explore, from an independent point of view,<br />

what the Windows architecture of services looks like <strong>and</strong> what the inner functionality of a service is.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!