예제 #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            AppDomain.CurrentDomain.UnhandledException       += CurrentDomain_UnhandledException;
            Application.Current.DispatcherUnhandledException += Application_DispatcherUnhandledException;

            //禁止休眠
            SystemSleepManagement.PreventSleep(true);
        }
예제 #2
0
 public login()
 {
     InitializeComponent();
     SystemSleepManagement.PreventSleep(true);
     textBox3.Text = softReg.GetMNum();
     if (ConfigHelper.GetAppConfig("sfjz") == "是")
     {
         checkBox1.Checked = true;
         textBox1.Text     = ConfigHelper.GetAppConfig("user");
         textBox2.Text     = ConfigHelper.GetAppConfig("pass");
     }
 }
예제 #3
0
 private void Current_Activated(object sender, EventArgs e)
 {
     SystemSleepManagement.PreventSleep();
     Debug.WriteLine("阻止系统休眠");
 }
예제 #4
0
 private void Current_Deactivated(object sender, EventArgs e)
 {
     SystemSleepManagement.RestoreSleep();
     Debug.WriteLine("恢复系统休眠策略");
 }