Ejemplo n.º 1
0
        public void Connect()
        {
            var host = ConsoleRunner.GetHost();
            var port = ConsoleRunner.GetPort();
            var username = ConsoleRunner.GetUsername();
            var password = ConsoleRunner.GetPassword();

            _sshClient = new SSHClient(host, port, username, password);
            _sshClient.Connect();
        }
Ejemplo n.º 2
0
 private void ConnectClient()
 {
     try
     {
         _sshClient = new SSHClient(textBoxHost.Text, textBoxPort.Text, textBoxUsername.Text, passwordBox.Password);
         _sshClient.Connect();
         if (_sshClient.IsConnected)
         {
             labelStatus.Content = "Connected";
             labelStatus.Visibility = Visibility.Visible;
             LoadShell();
         }
         else
         {
             labelStatus.Content = "Not Connected";
             labelStatus.Visibility = Visibility.Visible;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }