Exemplo n.º 1
0
        public SFTPClient(string url, string username = null, string password = null)
        {
            UrlEntity = new SFTPUrl {
                Url = url
            };
            this.username = username;
            this.password = password;
            JSch jsch = new JSch();

            session = jsch.getSession(username, UrlEntity.IP, UrlEntity.Port);
            STFPUserInfo userInfo = new STFPUserInfo(password);

            session.setUserInfo(userInfo);
        }
Exemplo n.º 2
0
        public SFTPClient(string ip = null, int port = 22, string filePath = null, string username = null, string password = null)
        {
            UrlEntity = new SFTPUrl {
                IP = ip, Port = port, Path = filePath
            };
            this.username = username;
            this.password = password;
            JSch jsch = new JSch();

            session = jsch.getSession(username, ip, port);
            STFPUserInfo userInfo = new STFPUserInfo(password);

            session.setUserInfo(userInfo);
        }