Interacting with Windows Services


You can view the services that are used on your computer by opening the Service Control Manager user interface. To do so in Windows 2000, select Administrative Tools image from book Services in the Control Panel. In Windows XP Professional, select Start image from book All Programs image from book Administrative Tools image from book Services. Using the Service Control Manager, a service can be set to automatically start when the system is booted, or a service can be started manually. Services can also be stopped or paused. The list of services contained in the Service Control Manager includes the current state for each service. Figure 31-1 shows the Service Control Manager in Windows XP.

image from book
Figure 31-1

The Status column indicates the current state of the service. If this column is blank, the service has not been started since the last time the computer was booted. Other possible values for Status are Started, Stopped, and Paused. You can access additional settings and details concerning a service by double-clicking it.

When a service is started, it automatically logs into the system using either a user or system account:

  • The user account is a regular NT account that allows the program to interact with the system - in essence, the service impersonates a user.

  • The system account is not associated with a particular user.

The Service Control Manager shown in Figure 31-1 is part of the operating system (OS), which is what supports Windows Services; it is not a part of the .NET Framework. Any service run by the OS is exposed through the Service Control Manager, no matter how the service was created or installed. You can also interact with Windows Services via the Server Explorer in Visual Studio 2005. You’ll see this technique later.




Professional VB 2005 with. NET 3. 0
Professional VB 2005 with .NET 3.0 (Programmer to Programmer)
ISBN: 0470124709
EAN: 2147483647
Year: 2004
Pages: 267

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net