The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ServiceBase.CanHandleSessionChangeEvent Property

Gets or sets a value that indicates whether the service can handle session change events received from a Terminal Server session.

Namespace: System.ServiceProcess
Assembly: System.ServiceProcess (in system.serviceprocess.dll)

public bool CanHandleSessionChangeEvent { get; set; }
/** @property */
public boolean get_CanHandleSessionChangeEvent ()

/** @property */
public void set_CanHandleSessionChangeEvent (boolean value)

public function get CanHandleSessionChangeEvent () : boolean

public function set CanHandleSessionChangeEvent (value : boolean)

Not applicable.

Property Value

true if the service can handle Terminal Server session change events; otherwise, false.

Exception typeCondition


This property is modified after the service was started.

The following code example shows the use of the CanHandleSessionChangeEvent property to indicate that a class derived from ServiceBase can handle the event. This code example is part of a larger example provided for the ServiceBase class.

public SimpleService()
    CanPauseAndContinue = true;
    CanHandleSessionChangeEvent = true;
    ServiceName = "SimpleService";

Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft