using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Tamir.SharpSsh; using Tamir.SharpSsh.jsch; using Tamir.Streams; namespace WpfApplication1 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void image1_ImageFailed(object sender, ExceptionRoutedEventArgs e) { } public void textBox1_TextChanged(object sender, TextChangedEventArgs e) { string strval = textBox1.Text; } public void button2_Click(object sender, RoutedEventArgs e) { string host = "192.168.1.9"; string uname = "root"; string passwd = "test"; string commnd = "ls"; SshStream ssh = new SshStream(host, uname, passwd); //Set the end of response matcher character //Tamir.SharpSsh.SshStream (host, uname, passwd); ssh.Prompt = "ls"; //Remove terminal emulation characters ssh.RemoveTerminalEmulationCharacters = true; ssh.Write(commnd+textBox1.Text); string response = ssh.ReadResponse(); Console.Write(response); } public void viewbox1_show(object sender, TextChangedEventArgs e) { } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)