WinFormRExec - GUI remote exec
SSH remote exec utility - executes a simple command at the SSH server.
Connects to the specified SSH server, executes a single command and displays the command output in a TextBox control. Scripting object is usd to execute the command and read the response - check out Scripting for more information.
This sample demonstrates:
- Using Ssh and Scripting classes.
- Executing a command at the server.
- Reading a response from the server.
C#
// Handles the 'SendCommand' button click event // send the command using an Ssh object initialized elsewhere (eg. in Form.Load event) Scripting scripting = ssh.StartScripting("dir"); // read the response of the command string response = scripting.ReadUntil(ScriptEvent.Closed); // append the response to the some TextBox textBox.AppendText(response);
VB.NET
' Handles the 'SendCommand' button click event ' send the command using an Ssh object initialized elsewhere (eg. in Form.Load event) Dim scripting As Scripting = ssh.StartScripting("dir") ' read the response of the command Dim response As String = Scripting.ReadUntil(ScriptEvent.Closed) ' append the response to the some TextBox textBox.AppendText(response)