示例#1
0
        public static ClientBase Create(ClientTypes type, ClientAuthorition authorition)
        {
            switch (type)
            {
            case ClientTypes.SSH:
                return(new SSHClient(authorition));

            default:
                throw new NotImplementedException();
            }
        }
示例#2
0
        private void RunSSHClient(SSHClientAuthorition authorition, IVideoTerminal terminal)
        {
            this.authorition          = authorition;
            this.terminal             = terminal;
            this.terminal.InputEvent += this.Terminal_InputEvent;

            this.vtParser              = new VTParser();
            this.vtParser.ActionEvent += VtParser_ActionEvent;
            this.vtParser.Initialize();

            this.client = ClientFactory.CreateSSHClient(authorition.ServerAddress, authorition.ServerPort, authorition.UserName, authorition.Password);
            this.client.StatusChanged += this.Client_StatusChanged;
            this.client.DataReceived  += this.Client_DataReceived;
            this.client.Connect();
        }
示例#3
0
 public SSHClient(ClientAuthorition authorition) :
     base(authorition)
 {
 }
示例#4
0
 public ClientBase(ClientAuthorition authorition)
 {
     this.Authorition = authorition;
 }
示例#5
0
 public SerialPortClient(ClientAuthorition authorition) : base(authorition)
 {
 }
示例#6
0
        public static ClientBase CreateSSHClient(string ip, int port, string userName, string password)
        {
            ClientAuthorition authorition = CreateSSHClientAuthorition(ip, port, userName, password);

            return(ClientFactory.Create(ClientTypes.SSH, authorition));
        }