private void OpenConnect(Host host) { var conneInfo = CreateConnectionInfo(host); _sshClient = new SshClient(conneInfo); _sshClient.Connect(); WriteOutput("Connected"); _vm.HasConnected = true; project = new XrayProject(_sshClient, Record.Settings, WriteOutput); }
private void Install(object sender, RoutedEventArgs e) { XrayProject project = new XrayProject( _sshClient, Record.Settings, WriteShell); Task.Factory.StartNew(() => { project.Install(); }); }
private void OpenConnect(Host host) { WriteOutput("正在登陆服务器 ..."); var conneInfo = CreateConnectionInfo(host); _sshClient = new SshClient(conneInfo); try { _sshClient.Connect(); } catch (Exception ex) { WriteOutput(ex.Message); } WriteOutput("登陆服务器成功!"); _vm.HasConnected = true; project = new XrayProject(_sshClient, Record.Settings, WriteOutput); }
private void OpenConnect() { WriteOutput("正在登陆服务器 ..."); var conneInfo = CreateConnectionInfo(ViewModel.Host); _sshClient = new SshClient(conneInfo); try { _sshClient.Connect(); } catch (Exception ex) { WriteOutput("登陆失败!"); WriteOutput(ex.Message); return; } WriteOutput("登陆服务器成功!"); ViewModel.Connected = true; Project = new XrayProject(_sshClient, ViewModel.Settings, WriteOutput); }
private void Install(object sender, RoutedEventArgs e) { var project = new XrayProject( _sshClient, new XrayParameters { Port = 443 }, WriteShell ); Task.Run(() => { try { project.Execute(); } catch (Exception ex) { _vm.AddOutput(ex.Message); } }); }