Пример #1
0
        private void btnRestart_Click(object sender, EventArgs e)
        {
            SSHResult _resultForm = new SSHResult();
            var       _response   = _SShClientAdapter.RunSSHCommand("sudo reboot");

            _resultForm.Controls["txtBoxSSHResult"].Text = string.IsNullOrEmpty(_response)? "Success": _response;
            _resultForm.ShowDialog();
        }
Пример #2
0
        private void btnScreenShot_Click(object sender, EventArgs e)
        {
            SSHResult _resultForm = new SSHResult();
            var       _response   = _SShClientAdapter.RunSSHCommand("sudo screencapture test.png");

            ((RichTextBox)_resultForm.Controls["txtBoxSSHResult"]).Text = string.IsNullOrEmpty(_response) ? "Success" : _response;;

            _SShClientAdapter.RunSSHDownloadCommand("test.png", "test.png");
            ((PictureBox)_resultForm.Controls["pBoxScreenShot"]).ImageLocation = "test.png";

            _resultForm.ShowDialog();
        }
Пример #3
0
        private void btnRunCommand_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtSShCommand.Text))
            {
                SSHResult _resultForm = new SSHResult();
                var       _response   = _SShClientAdapter.RunSSHCommand(txtSShCommand.Text);

                _resultForm.Controls["txtBoxSSHResult"].Text = string.IsNullOrEmpty(_response) ? "Success" : _response;
                _resultForm.ShowDialog();
            }
            else
            {
                MessageBox.Show("Please enter a command");
            }
        }