SessionChangeDescription.Reason プロパティ
アセンブリ: System.ServiceProcess (system.serviceprocess.dll 内)

SessionChangeReason 値の 1 つ。

ServiceBase から派生したクラスの OnSessionChange メソッドの実装で、Reason プロパティを使用するコード例を次に示します。このコード例は、ServiceBase クラスのトピックで取り上げているコード例の一部分です。
' Handle a session change notice Protected Overrides Sub OnSessionChange(ByVal changeDescription As SessionChangeDescription) #If LOGEVENTS Then System.Diagnostics.EventLog.WriteEntry("SimpleService.OnSessionChange", _ DateTime.Now.ToLongTimeString() + " - Session change notice recieved: " + _ changeDescription.Reason.ToString() + " Session ID: " + _ changeDescription.SessionId.ToString()) #End If
// Handle a session change notice protected override void OnSessionChange(SessionChangeDescription changeDescription) { #if LOGEVENTS EventLog.WriteEntry("SimpleService.OnSessionChange", DateTime.Now.ToLongTimeString() + " - Session change notice received: " + changeDescription.Reason.ToString() + " Session ID: " + changeDescription.SessionId.ToString()); #endif


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- SessionChangeDescription.Reason プロパティのページへのリンク