Пример #1
0
        public FtpClient(FtpClientConfiguration configuration)
        {
            this.configuration = configuration;

            if (configuration.Host == null)
            {
                throw new ArgumentNullException(nameof(configuration.Host));
            }
        }
Пример #2
0
        public FtpClient(FtpClientConfiguration configuration)
        {
            this.Configuration = configuration;

            if (configuration.Host == null)
            {
                throw new ArgumentNullException(nameof(configuration.Host));
            }

            dnsResolver = new DnsResolver();
        }
Пример #3
0
        public void Configure(FtpClientConfiguration configuration)
        {
            Configuration = configuration;

            if (configuration.Host == null)
            {
                throw new ArgumentNullException(nameof(configuration.Host));
            }

            ControlStream = new FtpControlStream(Configuration, new DnsResolver());
            Configuration.BaseDirectory = $"/{Configuration.BaseDirectory.TrimStart( '/' )}";
        }
Пример #4
0
        public void Configure(FtpClientConfiguration configuration)
        {
            Configuration = configuration;

            if (configuration.Host == null)
            {
                throw new ArgumentNullException(nameof(configuration.Host));
            }

            if (Uri.IsWellFormedUriString(configuration.Host, UriKind.Absolute))
            {
                configuration.Host = new Uri(configuration.Host).Host;
            }


            ControlStream = new FtpControlStream(Configuration, new DnsResolver());
            Configuration.BaseDirectory = $"/{Configuration.BaseDirectory.TrimStart( '/' )}";
        }
Пример #5
0
 public FtpClient(FtpClientConfiguration configuration)
 {
     Configure(configuration);
 }