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(); }
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(); }
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"); } }