public void lockdown() { //调用配置文件中的mode MainWindow ma = new MainWindow(); string mode = ma.Obtain("mode"); //锁屏 if (mode == "1") { //打开密码锁屏窗口,关闭当前窗口 LockScreenKey screen = new LockScreenKey(); screen.Show(); this.Close(); } else if (mode == "2") { //打开密码锁屏窗口,密码为时间 LockScreenKey screen = new LockScreenKey(); screen.Show(); this.Close(); } else if (mode == "3") { //打开U盘锁屏窗口,关闭当前窗口 LockScreen screen = new LockScreen(); screen.Show(); this.Close(); } }
private void AccidentalClosure() { if (Obtain("lock") == "true") { if (Obtain("mode") == "1") { //打开密码锁屏窗口,关闭当前窗口 LockScreenKey screen = new LockScreenKey(); screen.Show(); this.Close(); } else if (Obtain("mode") == "2") { //打开密码锁屏窗口,密码为时间 LockScreenKey screen = new LockScreenKey(); screen.Show(); this.Close(); } else if (Obtain("mode") == "3") { //打开U盘锁屏窗口,关闭当前窗口 LockScreen screen = new LockScreen(); screen.Show(); this.Close(); } } }
private void img1_MouseDown(object sender, MouseButtonEventArgs e) { //获得配置文件closemain MainWindow ma = new MainWindow(); //关闭主窗口 ma.Modify("closemain", "true"); //打开U盘锁屏窗口,关闭当前窗口 LockScreen screen = new LockScreen(); screen.Show(); this.Close(); }