コード例 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Turn to Windows Mode", "Stop", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }
            DLG_Login dLG_Login = new DLG_Login(ref opciones, 1);

            Application.DoEvents();
            dLG_Login.Focus();
            dLG_Login.ShowDialog();
            int logeado = dLG_Login.Logeado;

            if (logeado == 1)
            {
                reboot = 1;
                string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
                string path       = folderPath + "\\Toolwiz Time Freeze 2014\\ToolwizTimeFreeze.exe";
                if (File.Exists(path) && Configuracion.Freeze_Check() == 1)
                {
                    Configuracion.Freeze_Build_Timestamp();
                    Configuracion.Freeze_Build_TimestampBoot();
                    Configuracion.Freeze_Off();
                    Configuracion.WinReset();
                }
                else
                {
                    MWin.UnLock_Windows();
                    try
                    {
                        RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon", writable: true);
                        registryKey.SetValue("Shell", "explorer.exe", RegistryValueKind.String);
                        registryKey.Close();
                    }
                    catch
                    {
                    }
                    try
                    {
                        RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon", writable: true);
                        registryKey.SetValue("Shell", "explorer.exe", RegistryValueKind.String);
                        registryKey.Close();
                    }
                    catch
                    {
                    }
                    Configuracion.Access_Log("Turn Windows Mode");
                    Configuracion.WinReset();
                }
            }
        }
コード例 #2
0
 private void bFreeze_Click(object sender, EventArgs e)
 {
     if (Configuracion.Freeze_Check() == 1)
     {
         if (MessageBox.Show("Turn to UNFREEZED MODE", "Stop", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             DLG_Login dLG_Login = new DLG_Login(ref opciones, 1);
             Application.DoEvents();
             dLG_Login.Focus();
             dLG_Login.ShowDialog();
             int logeado = dLG_Login.Logeado;
             if (logeado == 1)
             {
                 Configuracion.Freeze_Build_Timestamp();
                 Configuracion.Freeze_Off();
                 Configuracion.WinReset();
             }
         }
     }
     else
     {
         MessageBox.Show("System is UNFREEZED");
     }
 }