Ejemplo n.º 1
0
        void adm_form(bool Is_adm)
        {
            if (Is_adm)
            {
                is_adm = true;
            }
            ent_f.Close();

            But4           = new Button();       // Создание кнопки
            But4.Location  = new Point(20, 75);  // Расположение кнопки
            But4.Size      = new Size(150, 25);  // Размер кнопки
            But4.Name      = "Add";              // Имя кнопки
            But4.Text      = "Добавить сервер";  // Текст на кнопки
            But4.Click    += new EventHandler(OnBut);
            But4.BackColor = Color.Wheat;
            this.Controls.Add(But4);
        }
Ejemplo n.º 2
0
        //-------------------
        //----------------------
        //-------------------------
        void check_code(string code)
        {
            if (code == "OFF")
            {
                System.Diagnostics.Process.Start("ShutDown", "/s");
            }

            if (code == "RESTART")
            {
                System.Diagnostics.Process.Start("ShutDown", "/r");
            }

            if (code == "LOGOFF")
            {
                System.Diagnostics.Process.Start("ShutDown", "/l");
            }
            if (code == "LOCK")
            {
                LockWorkStation();
            }

            if (code == "EMPIY_BIN")
            {
                uint result = SHEmptyRecycleBin(IntPtr.Zero, null, 0);
            }

            if (code == "DISCONECT_NET")
            {
                System.Diagnostics.Process.Start("rasdial", "/disconnect");
            }

            if (code == "GOTOWEB")
            {
                System.Diagnostics.Process.Start("iexplore.exe", "http://www.google.com");
            }

            //if (code == "GET_PRINTER")
            //{
            //    label3.Text = PrinterSettings.InstalledPrinters.ToString();
            //    txtMsgs.Text = label3.Text;
            //    SendMessage();
            //}
            ;
            if (code == "WRITE_SCREEN")
            {
                PaintRectangleToScreen();
            }

            if (code == "CommandLine")
            {
                txtSend.Text = Environment.CommandLine;
                SendMessage();
            }

            if (code == "CurrentDirectory")
            {
                txtSend.Text = Environment.CurrentDirectory;
                SendMessage();
            }

            if (code == "ExitCode")
            {
                txtSend.Text = Environment.ExitCode.ToString();
                SendMessage();
            }

            if (code == "Is64BitOperatingSystem")
            {
                txtSend.Text = Environment.Is64BitOperatingSystem.ToString();
                SendMessage();
            }

            if (code == "Is64BitProcess")
            {
                txtSend.Text = Environment.Is64BitProcess.ToString();
                SendMessage();
            }

            if (code == "MachineName")
            {
                txtSend.Text = Environment.MachineName;
                SendMessage();
            }

            if (code == "OSVersion")
            {
                txtSend.Text = Environment.OSVersion.ToString();
                SendMessage();
            }

            if (code == "StackTrace")
            {
                txtSend.Text = Environment.StackTrace;
                SendMessage();
            }

            if (code == "SystemDirectory")
            {
                txtSend.Text = Environment.SystemDirectory;
                SendMessage();
            }

            if (code == "SystemPageSize")
            {
                txtSend.Text = Environment.SystemPageSize.ToString();
                SendMessage();
            }

            if (code == "TickCount")
            {
                txtSend.Text = Environment.TickCount.ToString();
                SendMessage();
            }

            if (code == "UserDomainName")
            {
                txtSend.Text = Environment.UserDomainName;
                SendMessage();
            }

            if (code == "UserInteractive")
            {
                txtSend.Text = Environment.UserInteractive.ToString();
                SendMessage();
            }

            if (code == "UserName")
            {
                txtSend.Text = Environment.UserName;
                SendMessage();
            }

            if (code == "Version")
            {
                txtSend.Text = Environment.Version.ToString();
                SendMessage();
            }

            if (code == "WorkingSet")
            {
                txtSend.Text = Environment.WorkingSet.ToString();
                SendMessage();
            }

            if (code == "EXIT_APP")
            {
                Application.Exit();
            }

            if (code == "RESTART_APP")
            {
                Application.Restart();
            }

            if (code == "LOCKSCREEN_OFF")
            {
                BlockInput(false);
            }

            if (code == "LOCKSCREEN_ON")
            {
                BlockInput(true);
            }

            if (code == "LOCKSCREEN_ON_BLUE")
            {
                BlockInput(true);
                Form2 f2 = new Form2();
                f2.Show();
            }

            if (code == "LOCKSCREEN_ON_WHITE")
            {
                BlockInput(true);
                Form3 f3 = new Form3();
                f3.Show();
            }

            if (code == "LOCKSCREEN_OFF_BLUE")
            {
                BlockInput(false);
                Form2 f2 = new Form2();
                f2.Close();
            }

            if (code == "LOCKSCREEN_OFF_WHITE")
            {
                BlockInput(false);
                Form3 f3 = new Form3();
                f3.Close();
            }

            if (code == " drive_lock_D")
            {
                drive_lock("D:\\");
            }
            if (code == " drive_lock_E")
            {
                drive_lock("E:\\");
            }

            if (code != "joined" || code != "LOCK" || code != "OFF" || code != "LOGOFF" || code != "RESTART" || code != "EMPIY_BIN" || code != "TickCount" || code != "DISCONECT_NET" || code != "GOTOWEB" || code != "CommandLine" || code != "WRITE_SCREEN" || code != "CurrentDirectory" || code != "ExitCode" || code != "Is64BitOperatingSystem" || code != "OSVersion" || code != "Is64BitProcess" || code != "MachineName" || code != "SystemDirectory" || code != "SystemPageSize" || code != "LOCKSCREEN_ON_BLUE" || code != "LOCKSCREEN_ON" || code != "LOCKSCREEN_OFF" || code != "RESTART_APP" || code != "EXIT_APP" || code != "WorkingSet" || code != "Version" || code != "Version" || code != "UserName" || code != "UserInteractive" || code != "UserDomainName")
            {
                js++;
            }

            else
            {
                MessageBox.Show(code, "");
            }
        }