Example #1
0
        public FtpClient(string url)
        {
            if (String.IsNullOrEmpty(url))
                throw new ArgumentException(url);

            Uri uri = new Uri(url);

            if (uri.Scheme != Uri.UriSchemeFtp)
                throw new ArgumentException("uri");

            _connection = new FtpConnection(uri);

            _session = new FtpSession(_connection);
        }
Example #2
0
        public FtpClient(IPEndPoint ipEndPoint)
        {
            if (ipEndPoint == null)
                throw new NullReferenceException("ipEndPoint");

            Uri uri = new Uri(String.Format("ftp://{0}:{1}", ipEndPoint.Address, ipEndPoint.Port));

            if (uri.Scheme != Uri.UriSchemeFtp)
                throw new ArgumentException("ipEndPoint");

            _connection = new FtpConnection(uri);

            _session = new FtpSession(_connection);
        }
Example #3
0
        public FtpClient(IPEndPoint ipEndPoint, string username, string password)
        {
            if (ipEndPoint == null)
                throw new NullReferenceException("ipEndPoint");

            Uri uri = new Uri(String.Format("ftp://{0}:{1}", ipEndPoint.Address, ipEndPoint.Port));

            if (uri.Scheme != Uri.UriSchemeFtp)
                throw new ArgumentException("ipEndPoint");

            if (String.IsNullOrEmpty(username))
                throw new ArgumentException("username");

            if (String.IsNullOrEmpty(password))
                throw new ArgumentException("password");

            _connection = new FtpConnection(uri, username, password);

            _session = new FtpSession(_connection);
        }
Example #4
0
 public FtpSession(FtpConnection connection)
 {
     _connection = connection;
     _credential = new NetworkCredential(_connection.Username, _connection.Password);
 }
Example #5
0
        public FtpClient(string url, string username, string password)
        {
            if (String.IsNullOrEmpty(url))
                throw new ArgumentException(url);

            if (String.IsNullOrEmpty(username))
                throw new ArgumentException("username");

            if (String.IsNullOrEmpty(password))
                throw new ArgumentException("password");

            Uri uri = new Uri(url);

            if (uri.Scheme != Uri.UriSchemeFtp)
                throw new ArgumentException("uri");

            _connection = new FtpConnection(uri, username, password);

            _session = new FtpSession(_connection);
        }