コード例 #1
0
        public LibSshNetConnection(string host, string username, string password)
        {
            Session = new Session();
            Session.SetOption(SshOption.Host, host);
            Session.SetOption(SshOption.Port, 22);
            Session.SetOption(SshOption.User, username);
            //			Session.SetOption(SshOption.CiphersCS, "aes256-cbc");
            Session.Connect();

            Session.PasswordAuth(password);

            Pty = new Channel(Session);
            Pty.RequestPty("xterm", 160, 40);
            Pty.RequestShell();

            stream = new LibSshNetStream(this);
        }
コード例 #2
0
        public LibSshNetConnection(string host, string username, string password)
        {
            Session = new Session();
            Session.SetOption(SshOption.Host, host);
            Session.SetOption(SshOption.Port, 22);
            Session.SetOption(SshOption.User, username);
//			Session.SetOption(SshOption.CiphersCS, "aes256-cbc");
            Session.Connect();

            Session.PasswordAuth(password);

            Pty = new Channel(Session);
            Pty.RequestPty("xterm", 160, 40);
            Pty.RequestShell();

            stream = new LibSshNetStream(this);
        }
コード例 #3
0
        public void Connect(IStreamNotifier notifier, ConnectionSettings settings)
        {
            this.settings = settings;
            stream        = notifier.Stream as ShellStream;
            var terminal = new XtermTerminal(notifier)
            {
                Size        = new Terminal.Point(App.DefaultTerminalCols, App.DefaultTerminalRows),
                DefaultFont = new TerminalFont()
                {
                    Foreground = TerminalColors.GetBasicColor(7)
                }
            };

            terminal.StreamException += Terminal_StreamException;
            terminal.TitleChanged    += (sender, e) =>
            {
                Title = e.Title;
            };

            Terminal = terminal;
        }
コード例 #4
0
 public LibSshNetStreamNotifier(TerminalControl terminal, LibSshNetStream stream)
 {
     this.terminal        = terminal;
     Stream               = stream;
     stream.DataReceived += Stream_DataReceived;
 }