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); }
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); }
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); }
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); }