Пример #1
0
        public void ApplySettings(SettingInfoBase settings)
        {
            ComponentPro.Net.Ftp client = (ComponentPro.Net.Ftp)_client;

            client.Config.KeepAliveDuringIdleInterval = settings.Get <int>(SettingInfo.KeepAlive);
            client.TransferMode                       = settings.Get <bool>(FtpSettingInfo.Compress) ? FtpTransferMode.ZlibCompressed : FtpTransferMode.Stream;
            client.Config.SendAbortCommand            = settings.Get <OptionValue>(FtpSettingInfo.SendAborCommand);
            client.Config.SendTelnetInterruptSignal   = settings.Get <bool>(FtpSettingInfo.SendAbortSignals);
            client.ChangeDirectoryBeforeFileOperation = settings.Get <bool>(FtpSettingInfo.ChangeDirBeforeTransfer);
            client.ChangeDirectoryBeforeListing       = settings.Get <bool>(FtpSettingInfo.ChangeDirBeforeListing);
            client.Config.SmartPathResolving          = settings.Get <bool>(FtpSettingInfo.SmartPath);
        }
Пример #2
0
        public IRemoteFileSystem Create()
        {
            ComponentPro.Net.Ftp client = new ComponentPro.Net.Ftp();

#if !Framework4_5
            client.SetMultipleFilesPermissionsCompleted += client_SetMultipleFilesPermissionsCompleted;
            client.UploadUniqueFileCompleted            += client_UploadUniqueFileCompleted;
            client.CertificateRequired += client_CertificateRequired;
            client.CertificateReceived += client_CertificateReceived;
#endif

            _client = client;

            return(_client);
        }
Пример #3
0
        public void ApplyLoginSettings(SettingInfoBase settings)
        {
            ComponentPro.Net.Ftp ftp = (ComponentPro.Net.Ftp)_client;

            ftp.Passive = _loginSettings.Get <bool>(FtpLoginInfo.PasvMode);

            string proxyServer = _loginSettings.Get <string>(LoginInfo.ProxyServer);
            int    proxyPort   = _loginSettings.Get <int>(LoginInfo.ProxyPort);

            if (!string.IsNullOrEmpty(proxyServer) && proxyPort > 0)
            {
                FtpProxy proxy = new FtpProxy();
                ftp.Proxy = proxy;

                proxy.Server               = proxyServer;
                proxy.Port                 = proxyPort;
                proxy.UserName             = _loginSettings.Get <string>(LoginInfo.ProxyUser);
                proxy.Password             = _loginSettings.Get <string>(LoginInfo.ProxyPassword);
                proxy.Domain               = _loginSettings.Get <string>(LoginInfo.ProxyDomain);
                proxy.ProxyType            = _loginSettings.Get <FtpProxyType>(LoginInfo.ProxyType);
                proxy.AuthenticationMethod = _loginSettings.Get <FtpProxyHttpConnectAuthMethod>(LoginInfo.ProxyHttpAuthnMethod);
            }
        }