示例#1
0
        private void btnRestart_Click(object sender, EventArgs e)
        {
            Reboot power = new Reboot();

            isShutDown = true;
            power.halt(true, false);
        }
示例#2
0
        private void btnPowerOff_Click(object sender, EventArgs e)
        {
            try
            {
                if (!isSetting)
                {
                    if (programsList.Find(x => x.id == (sender as Button).TabIndex).name == "pass")
                    {
                        Autorization form = new Autorization(Decoder(programsList.Find(x => x.id == 95).name));
                        if (form.ShowDialog() != DialogResult.OK)
                        {
                            return;
                        }
                    }
                    switch ((sender as Button).TabIndex)
                    {
                    case 97:
                    {
                        isShutDown = true;
                        Process.Start("logoff");
                    }
                    break;

                    case 98:
                    {
                        Reboot power = new Reboot();
                        isShutDown = true;
                        power.halt(true, false);
                    }
                    break;

                    case 99:
                    {
                        Reboot power = new Reboot();
                        isShutDown = true;
                        power.halt(false, false);
                    }
                    break;

                    default:
                        break;
                    }
                }
                else
                {
                    if (!panel6.Visible)
                    {
                        panel6.Visible = true;
                        panel6.Left    = (sender as Button).Left - 120;
                        activeBut      = (sender as Button);
                        switch (programsList.Find(x => x.id == (sender as Button).TabIndex).name)
                        {
                        case "yes":
                            radioButton1.Checked = true;
                            break;

                        case "pass":
                            radioButton2.Checked = true;
                            break;

                        case "not":
                            radioButton3.Checked = true;
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        panel6.Visible = false;
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
示例#3
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            Reboot power = new Reboot();

            power.Lock();
        }