コード例 #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);
 }