FtpClient Properties

System.Net.FtpClient

Collapse image Expand Image Copy image CopyHover image

The FtpClient type exposes the following members.

Properties

  Name Description
Protected property BaseStream
Gets the base stream for talking to the server via the control connection.
Public property Capabilities
Gets the server capabilties represented by flags
Public property ClientCertificates
Client certificates to be used in SSL authentication process
Public property ConnectTimeout
Gets or sets the length of time in miliseconds to wait for a connection attempt to succeed before giving up. Default is 15000 (15 seconds).
Public property Credentials
Credentials used for authentication
Public property DataConnectionConnectTimeout
Gets or sets the length of time in miliseconds for a data connection to be established before giving up. Default is 15000 (15 seconds).
Public property DataConnectionEncryption
Indicates if data channel transfers should be encrypted. Only valid if EncryptionMode property is not equal to FtpSslMode.None.
Public property DataConnectionReadTimeout
Gets or sets the length of time in miliseconds the data channel should wait for the server to send data. Default value is 15000 (15 seconds).
Public property DataConnectionType
Data connection type, default is AutoPassive which tries a connection with EPSV first and if it fails then tries PASV before giving up. If you know exactly which kind of connection you need you can slightly increase performance by defining a speicific type of passive or active data connection here.
Public property EnableThreadSafeDataConnections
When this value is set to true (default) the control connection is cloned and a new connection the server is established for the data channel operation. This is a thread safe approach to make asynchronous operations on a single control connection transparent to the developer.
Public property Encoding
Gets the text encoding being used when talking with the server. The default value is Encoding.ASCII however upon connection, the client checks for UTF8 support and if it's there this property is switched over to Encoding.UTF8.
Public property EncryptionMode
Type of SSL to use, or none. Default is none. Explicit is TLS, Implicit is SSL.
Public property HashAlgorithms
Get the hash types supported by the server, if any. This is a recent extension to the protocol that is not fully standardized and is not guarateed to work. See here for more details: http://tools.ietf.org/html/draft-bryan-ftpext-hash-02
Public property Host
The server to connect to
Public property InternetProtocolVersions
Flags specifying which versions of the internet protocol to support when making a connection. All addresses returned during name resolution are tried until a successful connection is made. You can fine tune which versions of the internet protocol to use by adding or removing flags here. I.e., setting this property to FtpIpVersion.IPv4 will cause the connection process to ignore IPv6 addresses. The default value is ANY version.
Public property IsConnected
Gets a value indicating if the connection is alive
Public property IsDisposed
Gets a value indicating if this object has already been disposed.
Public property MaximumDereferenceCount
Gets or sets a value that controls the maximum depth of recursion that DereferenceLink() will follow symbolic links before giving up. You can also specify the value to be used as one of the overloaded parameters to the DereferenceLink() method. The default value is 20. Specifying -1 here means inifinitly try to resolve a link. This is not recommended for obvious reasons (stack overflow).
Public property Port
The port to connect to. If this value is set to 0 (Default) the port used will be determined by the type of SSL used or if no SSL is to be used it will automatically connect to port 21.
Public property ReadTimeout
Gets or sets the length of time wait in miliseconds for data to be read from the underlying stream. The default value is 15000 (15 seconds).
Public property SocketKeepAlive
Gets or sets a value indicating if SocketOption.KeepAlive should be set on the underlying stream's socket. If the connection is alive, the option is adjusted in real-time. The value is stored and the KeepAlive option is set accordingly upon any new connections. The value set here is also applied to all future data streams. It has no affect on cloned control connections or data connections already in progress. The default value is false.
Public property SocketPollInterval
Gets or sets the length of time in miliseconds that must pass since the last socket activity before calling Poll() on the socket to test for connectivity. Setting this interval too low will have a negative impact on perfomance. Setting this interval to 0 disables Poll()'ing all together. The default value is 15 seconds.
Public property SystemType
Gets the type of system/server that we're connected to.
Public property UngracefullDisconnection
Disconnect from the server without sending QUIT. This helps work around IOExceptions caused by buggy connection resets when closing the control connection.

See Also