Пример #1
0
		protected void _Connect()
		{
			_jsch = new JSch();
			//session.setConfig();
			_session = _jsch.getSession(this.Username, this.Host, this.Port);
			UserInfo ui = new DirectPasswordUserInfo(this.Password);
			_session.setUserInfo(ui);
			_session.connect();

			_csftp = (ChannelSftp)_session.openChannel("sftp");
			_csftp.connect();

			//RootPath = csftp.getHome();
			RootPath = "";
		}
Пример #2
0
        protected void _Connect()
        {
            _jsch = new JSch();
            //session.setConfig();
            _session = _jsch.getSession(this.Username, this.Host, this.Port);
            UserInfo ui = new DirectPasswordUserInfo(this.Password);

            _session.setUserInfo(ui);
            _session.connect();

            _csftp = (ChannelSftp)_session.openChannel("sftp");
            _csftp.connect();

            //RootPath = csftp.getHome();
            RootPath = "";
        }