public ControlWindow(SftpClient client, byte[] key) { InitializeComponent(); this.client = client; this.key = key; cs = new CryptoSystem(); Init(); }
private void Button_Sign_In_Click(object sender, RoutedEventArgs e) { try { var connectionInfo = new ConnectionInfo(Settings.HOST, TextBox_Username.Text, new PasswordAuthenticationMethod(TextBox_Username.Text, PasswordBox_Password.Password)); var client = new SftpClient(connectionInfo); client.Connect(); Hide(); new ControlWindow(client, CryptoSystem.GenerateKey(Encoding.UTF8.GetBytes(PasswordBox_Password.Password))).Show(); } catch (Renci.SshNet.Common.SshAuthenticationException) { MessageBox.Show(Strings.ERR_LOGIN, Strings.ERR_MSG); } catch (Exception ex) { MessageBox.Show(ex.Message); } }