FtpClient Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for Internet Pack for .NET
This page is generated from external data, please do not update

NamespacesInterfacesClassesEnumsImplements

Overview

The FtpClient class provides methods to communicate with a remote FTP server.

The following example shows how the FtpClient class can be used to connect to a remote FTP server and to retrieve the root directory list:

var ftpCilent = new FtpClient()
    {
        HostAddress = IPAddress.Parse("192.168.0.100"),
        Port = 2211,
        UserName = "%your_login%",
        Password = "%your_password%",
        ShowHiddenFiles = true
    };
ftpCilent.Open();
ftpCilent.Login();
ftpCilent.List(); // default is root directory

foreach (FtpListingItem item in ftpCilent.CurrentDirectoryContents)
{
    Console.WriteLine(item.FileName);
}


Location


Ancestor's members Protected's members

constructor

Creates a new instance of the FtpClient class.


Oxygene:   constructor
C#:   constructor()
VB:   Sub New


Account

Gets or sets the account information that can be sent to the server using the SendAccount method.

Account information can be considered as a kind of password that the remote system uses to grant certain privileges. The exact form and meaning of the account information depends on the specific FTP server implementation.



Oxygene:   property Account: String read write
C#:   String Account { get; set; }
VB:   Property Account As String


AutoRetrieveListing

Gets or sets a flag that enables or disables automatic retrieving of directory listings when the current remote directory is changed.



Oxygene:   property AutoRetrieveListing: Boolean read write
C#:   Boolean AutoRetrieveListing { get; set; }
VB:   Property AutoRetrieveListing As Boolean


Binding     (declared in Client)

Obsolete - Please use BindingV4 and BindingV6 instead.



Oxygene:   property Binding: Binding read
C#:   Binding Binding { get; }
VB:   Property ReadOnly Binding As Binding


BindingV4     (declared in Client)

Gets the binding which provides properties and methods such as address family, IPv4 address, port number etc for client to connect to the host network.



Oxygene:   property BindingV4: Binding read
C#:   Binding BindingV4 { get; }
VB:   Property ReadOnly BindingV4 As Binding


BindingV6     (declared in Client)

Gets the binding which provides properties and methods such as address family, IPv6 address, port number etc for client to connect to the host network.



Oxygene:   property BindingV6: Binding read
C#:   Binding BindingV6 { get; }
VB:   Property ReadOnly BindingV6 As Binding


ChangeDirectory

Changes the current directory to the specified one.

Uses the FTP protocol command CWD.


Oxygene:   method ChangeDirectory(directory: String)
C#:   void ChangeDirectory(String directory)
VB:   Sub ChangeDirectory(directory As String)


Parameters:

  • directory:


ChangeToParentDirectory

Changes the current directory to its parent directory.

Uses the FTP protocol command CDUP.


Oxygene:   method ChangeToParentDirectory
C#:   void ChangeToParentDirectory()
VB:   Sub ChangeToParentDirectory


Close

Closes the connection to the FTP server. This method doesn't send the QUIT FTP command to the server.


Oxygene:   method Close
C#:   void Close()
VB:   Sub Close


Connect (): Connection     (declared in Client)



Oxygene:   method Connect: Connection
C#:   Connection Connect()
VB:   Function Connect As Connection


Connect (IPAddress, Int32): Connection     (declared in Client)



Oxygene:   method Connect(host: IPAddress; port: Int32): Connection
C#:   Connection Connect(IPAddress host, Int32 port)
VB:   Function Connect(host As IPAddress, port As Int32) As Connection


Parameters:

  • host:
  • port:


Connect (String, Int32): Connection     (declared in Client)



Oxygene:   method Connect(hostname: String; port: Int32): Connection
C#:   Connection Connect(String hostname, Int32 port)
VB:   Function Connect(hostname As String, port As Int32) As Connection


Parameters:

  • hostname:
  • port:


Connect (IPAddress, Int32, Binding): Connection     (declared in Client)

Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).


Oxygene:   class method Connect(host: IPAddress; port: Int32; binding: Binding): Connection
C#:   static Connection Connect(IPAddress host, Int32 port, Binding binding)
VB:   Shared Function Connect(host As IPAddress, port As Int32, binding As Binding) As Connection


Parameters:

  • host:
  • port:
  • binding:


Connect (String, Int32, Binding): Connection     (declared in Client)

Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).


Oxygene:   class method Connect(hostname: String; port: Int32; binding: Binding): Connection
C#:   static Connection Connect(String hostname, Int32 port, Binding binding)
VB:   Shared Function Connect(hostname As String, port As Int32, binding As Binding) As Connection


Parameters:

  • hostname:
  • port:
  • binding:


Connected     (declared in CommandBasedClient)

Returns the state of CurrentConnection. If it is false then CurrentConnection is not specified (null).



Oxygene:   property Connected: Boolean read
C#:   Boolean Connected { get; }
VB:   Property ReadOnly Connected As Boolean


ConnectionClass     (declared in Client)

Use the ConnectionClass property to specify an alternative Connection class to be used for out coming data connections. The class described by the assigned Type must be a descendant of Connection, and will be used for all connections that are established after the property has been set. Existing connections are not affected by changing the property.

If ConnectionType is null (default), instances of the Connection base class will be used.



Oxygene:   property ConnectionClass: Type read write
C#:   Type ConnectionClass { get; set; }
VB:   Property ConnectionClass As Type


ConnectionFactory     (declared in Client)

Represents an interface for a connection.



Oxygene:   property ConnectionFactory: IConnectionFactory read write
C#:   IConnectionFactory ConnectionFactory { get; set; }
VB:   Property ConnectionFactory As IConnectionFactory


ConnectionPool   protected     (declared in Client)



Oxygene:   property ConnectionPool: ConnectionPool read write
C#:   ConnectionPool ConnectionPool { get; set; }
VB:   Property ConnectionPool As ConnectionPool


ConnectNew (IPAddress, Int32): Connection     (declared in Client)

Overloaded. Opens and returns new connection with specified IP address and port.


Oxygene:   method ConnectNew(host: IPAddress; port: Int32): Connection
C#:   Connection ConnectNew(IPAddress host, Int32 port)
VB:   Function ConnectNew(host As IPAddress, port As Int32) As Connection


Parameters:

  • host:
  • port:


ConnectNew (String, Int32): Connection     (declared in Client)



Oxygene:   method ConnectNew(hostname: String; port: Int32): Connection
C#:   Connection ConnectNew(String hostname, Int32 port)
VB:   Function ConnectNew(hostname As String, port As Int32) As Connection


Parameters:

  • hostname:
  • port:


CurrentConnection     (declared in CommandBasedClient)

Returns current connection.



Oxygene:   property CurrentConnection: Connection read
C#:   Connection CurrentConnection { get; }
VB:   Property ReadOnly CurrentConnection As Connection


CurrentDirectoryContents

The FtpListing instance representing the contents of the current directory on the remote server.



Oxygene:   property CurrentDirectoryContents: FtpListing read
C#:   FtpListing CurrentDirectoryContents { get; }
VB:   Property ReadOnly CurrentDirectoryContents As FtpListing


Delete

Deletes the specified file.

Uses the FTP protocol command DELE.


Oxygene:   method Delete(filename: String)
C#:   void Delete(String filename)
VB:   Sub Delete(filename As String)


Parameters:

  • filename:


DnsResolveType     (declared in Client)

Determines if the specified HostName should be look up only Once per application run (if you establish multiple connections to the server, the subsequent connections will use the cached IPAddress) or Always, for each connect (the Hostname will be resolved again for each subsequet connect).

You'll usually only change this setting off the defaut (Once) if you anticipate the IPAddress of the target host to change frequently.



Oxygene:   property DnsResolveType: DnsResolveType read write
C#:   DnsResolveType DnsResolveType { get; set; }
VB:   Property DnsResolveType As DnsResolveType


EnableNagle     (declared in Client)

Set its value to true to enable the Nagle algorithm for send coalescing.



Oxygene:   property EnableNagle: Boolean read write
C#:   Boolean EnableNagle { get; set; }
VB:   Property EnableNagle As Boolean


Encoding

Gets or sets the encoding for Retrieve, List and other methods that need proper encoding.

The default encoding is UTF-8.



Oxygene:   property Encoding: Encoding read write
C#:   Encoding Encoding { get; set; }
VB:   Property Encoding As Encoding


GetConnection   protected     (declared in Client)



Oxygene:   method GetConnection(host: IPAddress; port: Int32): Connection
C#:   Connection GetConnection(IPAddress host, Int32 port)
VB:   Function GetConnection(host As IPAddress, port As Int32) As Connection


Parameters:

  • host:
  • port:


GetCurrentDirectory

Returns the name of the current directory.

Uses the FTP protocol command PWD.


Oxygene:   method GetCurrentDirectory: String
C#:   String GetCurrentDirectory()
VB:   Function GetCurrentDirectory As String


HostAddress     (declared in Client)

Gets or sets an Internet Protocol (IP) address.



Oxygene:   property HostAddress: IPAddress read write
C#:   IPAddress HostAddress { get; set; }
VB:   Property HostAddress As IPAddress


HostName     (declared in Client)

The server host name or IP address that you intend the client to connect to.



Oxygene:   property HostName: String read write
C#:   String HostName { get; set; }
VB:   Property HostName As String


LastResponseNo     (declared in CommandBasedClient)



Oxygene:   property LastResponseNo: Int32 read
C#:   Int32 LastResponseNo { get; }
VB:   Property ReadOnly LastResponseNo As Int32


LastResponseText     (declared in CommandBasedClient)



Oxygene:   property LastResponseText: String read
C#:   String LastResponseText { get; }
VB:   Property ReadOnly LastResponseText As String


List (): String

Returns the list of files in the current working directory.

Uses the FTP protocol command LIST.


Oxygene:   method List: String
C#:   String List()
VB:   Function List As String


List (Boolean): String

Returns the list of files in the current working directory.

Uses the FTP protocol command LIST.


Oxygene:   method List(showHiddenFiles: Boolean): String
C#:   String List(Boolean showHiddenFiles)
VB:   Function List(showHiddenFiles As Boolean) As String


Parameters:

  • showHiddenFiles:


Login

Attempts to login to the remote server using the UserName and Password property values as credentials.


Oxygene:   method Login
C#:   void Login()
VB:   Sub Login


MakeDirectory

Creates a new directory on the remote server.

Uses the FTP protocol command MKD.


Oxygene:   method MakeDirectory(directory: String)
C#:   void MakeDirectory(String directory)
VB:   Sub MakeDirectory(directory As String)


Parameters:

  • directory:


NewConnection   protected     (declared in Client)



Oxygene:   method NewConnection(binding: Binding): Connection
C#:   Connection NewConnection(Binding binding)
VB:   Function NewConnection(binding As Binding) As Connection


Parameters:

  • binding:


OnLog     (declared in CommandBasedClient)



Oxygene:   event OnLog: ClientLogEvent
delegate: method Invoke(sender: Object; e: ClientLogArgs)

C#:   event ClientLogEvent OnLog
delegate: void Invoke(Object sender, ClientLogArgs e)

VB:   Event OnLog As ClientLogEvent
delegate: Sub Invoke(sender As Object, e As ClientLogArgs)


OnNewListing

This event is raised when a file listing is retrieved from the remote server.



Oxygene:   event OnNewListing: EventHandler
C#:   event EventHandler OnNewListing
VB:   Event OnNewListing As EventHandler


OnResolvedHostName     (declared in Client)

This event is fired after the hostname has been successfully resolved.



Oxygene:   event OnResolvedHostName: OnResolvedHostNameHandler
delegate: method Invoke(sender: Object; e: OnResolvedHostNameArgs)

C#:   event OnResolvedHostNameHandler OnResolvedHostName
delegate: void Invoke(Object sender, OnResolvedHostNameArgs e)

VB:   Event OnResolvedHostName As OnResolvedHostNameHandler
delegate: Sub Invoke(sender As Object, e As OnResolvedHostNameArgs)


OnResolveHostName     (declared in Client)

This event is fired before the Client attepts to resolve the sepcifed HostName to an IP address. It provides you with an option to perform the resolution yourself, obtain the IP address from an internal cache you're maintaing, or do some other processing (such as for example chaging the hostname to look up).



Oxygene:   event OnResolveHostName: OnResolveHostNameHandler
delegate: method Invoke(sender: Object; e: OnResolveHostNameArgs)

C#:   event OnResolveHostNameHandler OnResolveHostName
delegate: void Invoke(Object sender, OnResolveHostNameArgs e)

VB:   Event OnResolveHostName As OnResolveHostNameHandler
delegate: Sub Invoke(sender As Object, e As OnResolveHostNameArgs)


OnTransferProgress

This event is raised whenever any data package is sent in any direction.



Oxygene:   event OnTransferProgress: TransferProgressEventHandler
delegate: method Invoke(sender: Object; e: TransferProgressEventArgs)

C#:   event TransferProgressEventHandler OnTransferProgress
delegate: void Invoke(Object sender, TransferProgressEventArgs e)

VB:   Event OnTransferProgress As TransferProgressEventHandler
delegate: Sub Invoke(sender As Object, e As TransferProgressEventArgs)


OnTransferStart

This event is raised before a data transfer between client and remote server is started.



Oxygene:   event OnTransferStart: TransferStartEventHandler
delegate: method Invoke(sender: Object; e: TransferStartEventArgs)

C#:   event TransferStartEventHandler OnTransferStart
delegate: void Invoke(Object sender, TransferStartEventArgs e)

VB:   Event OnTransferStart As TransferStartEventHandler
delegate: Sub Invoke(sender As Object, e As TransferStartEventArgs)


Open

Opens a connection to the remote server using the specified HostName or both the HostAddress and Port property values.


Oxygene:   method Open
C#:   void Open()
VB:   Sub Open


Passive

Gets or sets a flag indicating that passive FTP mode should be used.



Oxygene:   property Passive: Boolean read write
C#:   Boolean Passive { get; set; }
VB:   Property Passive As Boolean


Password

Gets or sets a password used for authentication on the FTP server.



Oxygene:   property Password: String read write
C#:   String Password { get; set; }
VB:   Property Password As String


Port     (declared in Client)

The server Port that you intend the client to connect to.



Oxygene:   property Port: Int32 read write
C#:   Int32 Port { get; set; }
VB:   Property Port As Int32


Quit

Performs a logout from the remote server.

Uses the FTP protocol command QUIT.


Oxygene:   method Quit
C#:   void Quit()
VB:   Sub Quit


ReleaseConnection   protected     (declared in Client)



Oxygene:   method ReleaseConnection(connection: Connection)
C#:   void ReleaseConnection(Connection connection)
VB:   Sub ReleaseConnection(connection As Connection)


Parameters:

  • connection:


RemoveDirectory (String)

Deletes a directory on the remote server. This method cannot process non-empty directories.

Uses the FTP protocol command RMD.


Oxygene:   method RemoveDirectory(directory: String)
C#:   void RemoveDirectory(String directory)
VB:   Sub RemoveDirectory(directory As String)


Parameters:

  • directory:


RemoveDirectory (String, Boolean)

Deletes a directory on the remote server. This method can not only delete the directory but also its sub-directories and all files they contain.

Uses the FTP protocol command RMD.


Oxygene:   method RemoveDirectory(directory: String; recursive: Boolean)
C#:   void RemoveDirectory(String directory, Boolean recursive)
VB:   Sub RemoveDirectory(directory As String, recursive As Boolean)


Parameters:

  • directory:
  • recursive:


Rename

Renames a file on the remote server.

Uses the FTP protocol commands RNFR and RNTO.


Oxygene:   method Rename(from: String; to: String)
C#:   void Rename(String from, String to)
VB:   Sub Rename(from As String, to As String)


Parameters:

  • from:
  • to:


ResolveHostName   protected     (declared in Client)



Oxygene:   method ResolveHostName
C#:   void ResolveHostName()
VB:   Sub ResolveHostName


ResolveHostNameIfNeeded   protected     (declared in Client)



Oxygene:   method ResolveHostNameIfNeeded
C#:   void ResolveHostNameIfNeeded()
VB:   Sub ResolveHostNameIfNeeded


Retrieve (FtpListingItem, Stream)

Retrieves a file and puts its contents into the provided stream.

Uses the FTP protocol command RETR.


Oxygene:   method Retrieve(item: FtpListingItem; stream: Stream)
C#:   void Retrieve(FtpListingItem item, Stream stream)
VB:   Sub Retrieve(item As FtpListingItem, stream As Stream)


Parameters:

  • item:
  • stream:


Retrieve (String, Int64, Stream)

Retrieves a file and puts its contents into the provided stream.

Uses the FTP protocol command RETR.


Oxygene:   method Retrieve(filename: String; size: Int64; stream: Stream)
C#:   void Retrieve(String filename, Int64 size, Stream stream)
VB:   Sub Retrieve(filename As String, size As Int64, stream As Stream)


Parameters:

  • filename:
  • size:
  • stream:


SendAccount

Sends account information to the remote server.

Account information can be considered as a kind of password that the remote system uses to grant certain privileges. The exact form and meaning of the account information depends on the specific FTP server implementation.

Uses the FTP protocol command ACCT.


Oxygene:   method SendAccount
C#:   void SendAccount()
VB:   Sub SendAccount


SendAndWaitForResponse   protected     (declared in CommandBasedClient)



Oxygene:   method SendAndWaitForResponse(command: String; params validResponses: array of Int32): Boolean
C#:   Boolean SendAndWaitForResponse(String command, params Int32[] validResponses)
VB:   Function SendAndWaitForResponse(command As String, ParamArray validResponses As array of Int32) As Boolean


Parameters:

  • command:
  • validResponses:


SendLog (TransferDirection, String)   protected     (declared in CommandBasedClient)



Oxygene:   method SendLog(direction: TransferDirection; message: String)
C#:   void SendLog(TransferDirection direction, String message)
VB:   Sub SendLog(direction As TransferDirection, message As String)


Parameters:

  • direction:
  • message:


SendLog (TransferDirection, String, array of Object)   protected     (declared in CommandBasedClient)



Oxygene:   method SendLog(direction: TransferDirection; format: String; params parameters: array of Object)
C#:   void SendLog(TransferDirection direction, String format, params Object[] parameters)
VB:   Sub SendLog(direction As TransferDirection, format As String, ParamArray parameters As array of Object)


Parameters:

  • direction:
  • format:
  • parameters:


SetType

Sets the FTP data transfer type to either I (binary type) or A (ascii type).

Uses the FTP protocol command TYPE.


Oxygene:   method SetType(type: String)
C#:   void SetType(String type)
VB:   Sub SetType(type As String)


Parameters:

  • type:


ShowHiddenFiles

Gets or sets a flag that determines whether hidden files should be included into directory listings retrieved from the remote FTP server.



Oxygene:   property ShowHiddenFiles: Boolean read write
C#:   Boolean ShowHiddenFiles { get; set; }
VB:   Property ShowHiddenFiles As Boolean


SslOptions     (declared in Client)



Oxygene:   property SslOptions: SslConnectionFactory read write
C#:   SslConnectionFactory SslOptions { get; set; }
VB:   Property SslOptions As SslConnectionFactory


StartActiveConnection

Opens a connection to the remote FTP server in active mode.


Oxygene:   method StartActiveConnection
C#:   void StartActiveConnection()
VB:   Sub StartActiveConnection


StartPassiveConnection

Opens a connection to the remote FTP server in passive mode.


Oxygene:   method StartPassiveConnection
C#:   void StartPassiveConnection()
VB:   Sub StartPassiveConnection


Store

Sends a data stream to the remote server and stores it there as a file.

Uses the FTP protocol command STOR.


Oxygene:   method Store(filename: String; stream: Stream)
C#:   void Store(String filename, Stream stream)
VB:   Sub Store(filename As String, stream As Stream)


Parameters:

  • filename:
  • stream:


TriggerOnBytesReceived   protected



Oxygene:   method TriggerOnBytesReceived(sender: Object; e: EventArgs)
C#:   void TriggerOnBytesReceived(Object sender, EventArgs e)
VB:   Sub TriggerOnBytesReceived(sender As Object, e As EventArgs)


Parameters:

  • sender:
  • e:


TriggerOnNewListing



Oxygene:   method TriggerOnNewListing
C#:   void TriggerOnNewListing()
VB:   Sub TriggerOnNewListing


TriggerOnResolvedHostName   protected     (declared in Client)



Oxygene:   method TriggerOnResolvedHostName(hostname: String; address: IPAddress)
C#:   void TriggerOnResolvedHostName(String hostname, IPAddress address)
VB:   Sub TriggerOnResolvedHostName(hostname As String, address As IPAddress)


Parameters:

  • hostname:
  • address:


TriggerOnResolveHostName   protected     (declared in Client)



Oxygene:   method TriggerOnResolveHostName(var hostname: String)
C#:   void TriggerOnResolveHostName(ref String hostname)
VB:   Sub TriggerOnResolveHostName(ByRef hostname As String)


Parameters:

  • hostname:


TriggerOnTransferStart   protected



Oxygene:   method TriggerOnTransferStart(sender: Object; e: TransferStartEventArgs)
C#:   void TriggerOnTransferStart(Object sender, TransferStartEventArgs e)
VB:   Sub TriggerOnTransferStart(sender As Object, e As TransferStartEventArgs)


Parameters:

  • sender:
  • e:


UserName

Gets or sets a user name used for authentication on the FTP server.



Oxygene:   property UserName: String read write
C#:   String UserName { get; set; }
VB:   Property UserName As String


WaitForResponse   protected     (declared in CommandBasedClient)



Oxygene:   method WaitForResponse(params validResponses: array of Int32): Boolean
C#:   Boolean WaitForResponse(params Int32[] validResponses)
VB:   Function WaitForResponse(ParamArray validResponses As array of Int32) As Boolean


Parameters:

  • validResponses:

Account

Gets or sets the account information that can be sent to the server using the SendAccount method.

Account information can be considered as a kind of password that the remote system uses to grant certain privileges. The exact form and meaning of the account information depends on the specific FTP server implementation.



Oxygene:   property Account: String read write
C#:   String Account { get; set; }
VB:   Property Account As String


AutoRetrieveListing

Gets or sets a flag that enables or disables automatic retrieving of directory listings when the current remote directory is changed.



Oxygene:   property AutoRetrieveListing: Boolean read write
C#:   Boolean AutoRetrieveListing { get; set; }
VB:   Property AutoRetrieveListing As Boolean


Binding     (declared in Client)

Obsolete - Please use BindingV4 and BindingV6 instead.



Oxygene:   property Binding: Binding read
C#:   Binding Binding { get; }
VB:   Property ReadOnly Binding As Binding


BindingV4     (declared in Client)

Gets the binding which provides properties and methods such as address family, IPv4 address, port number etc for client to connect to the host network.



Oxygene:   property BindingV4: Binding read
C#:   Binding BindingV4 { get; }
VB:   Property ReadOnly BindingV4 As Binding


BindingV6     (declared in Client)

Gets the binding which provides properties and methods such as address family, IPv6 address, port number etc for client to connect to the host network.



Oxygene:   property BindingV6: Binding read
C#:   Binding BindingV6 { get; }
VB:   Property ReadOnly BindingV6 As Binding


Connected     (declared in CommandBasedClient)

Returns the state of CurrentConnection. If it is false then CurrentConnection is not specified (null).



Oxygene:   property Connected: Boolean read
C#:   Boolean Connected { get; }
VB:   Property ReadOnly Connected As Boolean


ConnectionClass     (declared in Client)

Use the ConnectionClass property to specify an alternative Connection class to be used for out coming data connections. The class described by the assigned Type must be a descendant of Connection, and will be used for all connections that are established after the property has been set. Existing connections are not affected by changing the property.

If ConnectionType is null (default), instances of the Connection base class will be used.



Oxygene:   property ConnectionClass: Type read write
C#:   Type ConnectionClass { get; set; }
VB:   Property ConnectionClass As Type


ConnectionFactory     (declared in Client)

Represents an interface for a connection.



Oxygene:   property ConnectionFactory: IConnectionFactory read write
C#:   IConnectionFactory ConnectionFactory { get; set; }
VB:   Property ConnectionFactory As IConnectionFactory


ConnectionPool   protected     (declared in Client)



Oxygene:   property ConnectionPool: ConnectionPool read write
C#:   ConnectionPool ConnectionPool { get; set; }
VB:   Property ConnectionPool As ConnectionPool


CurrentConnection     (declared in CommandBasedClient)

Returns current connection.



Oxygene:   property CurrentConnection: Connection read
C#:   Connection CurrentConnection { get; }
VB:   Property ReadOnly CurrentConnection As Connection


CurrentDirectoryContents

The FtpListing instance representing the contents of the current directory on the remote server.



Oxygene:   property CurrentDirectoryContents: FtpListing read
C#:   FtpListing CurrentDirectoryContents { get; }
VB:   Property ReadOnly CurrentDirectoryContents As FtpListing


DnsResolveType     (declared in Client)

Determines if the specified HostName should be look up only Once per application run (if you establish multiple connections to the server, the subsequent connections will use the cached IPAddress) or Always, for each connect (the Hostname will be resolved again for each subsequet connect).

You'll usually only change this setting off the defaut (Once) if you anticipate the IPAddress of the target host to change frequently.



Oxygene:   property DnsResolveType: DnsResolveType read write
C#:   DnsResolveType DnsResolveType { get; set; }
VB:   Property DnsResolveType As DnsResolveType


EnableNagle     (declared in Client)

Set its value to true to enable the Nagle algorithm for send coalescing.



Oxygene:   property EnableNagle: Boolean read write
C#:   Boolean EnableNagle { get; set; }
VB:   Property EnableNagle As Boolean


Encoding

Gets or sets the encoding for Retrieve, List and other methods that need proper encoding.

The default encoding is UTF-8.



Oxygene:   property Encoding: Encoding read write
C#:   Encoding Encoding { get; set; }
VB:   Property Encoding As Encoding


HostAddress     (declared in Client)

Gets or sets an Internet Protocol (IP) address.



Oxygene:   property HostAddress: IPAddress read write
C#:   IPAddress HostAddress { get; set; }
VB:   Property HostAddress As IPAddress


HostName     (declared in Client)

The server host name or IP address that you intend the client to connect to.



Oxygene:   property HostName: String read write
C#:   String HostName { get; set; }
VB:   Property HostName As String


LastResponseNo     (declared in CommandBasedClient)



Oxygene:   property LastResponseNo: Int32 read
C#:   Int32 LastResponseNo { get; }
VB:   Property ReadOnly LastResponseNo As Int32


LastResponseText     (declared in CommandBasedClient)



Oxygene:   property LastResponseText: String read
C#:   String LastResponseText { get; }
VB:   Property ReadOnly LastResponseText As String


Passive

Gets or sets a flag indicating that passive FTP mode should be used.



Oxygene:   property Passive: Boolean read write
C#:   Boolean Passive { get; set; }
VB:   Property Passive As Boolean


Password

Gets or sets a password used for authentication on the FTP server.



Oxygene:   property Password: String read write
C#:   String Password { get; set; }
VB:   Property Password As String


Port     (declared in Client)

The server Port that you intend the client to connect to.



Oxygene:   property Port: Int32 read write
C#:   Int32 Port { get; set; }
VB:   Property Port As Int32


ShowHiddenFiles

Gets or sets a flag that determines whether hidden files should be included into directory listings retrieved from the remote FTP server.



Oxygene:   property ShowHiddenFiles: Boolean read write
C#:   Boolean ShowHiddenFiles { get; set; }
VB:   Property ShowHiddenFiles As Boolean


SslOptions     (declared in Client)



Oxygene:   property SslOptions: SslConnectionFactory read write
C#:   SslConnectionFactory SslOptions { get; set; }
VB:   Property SslOptions As SslConnectionFactory


UserName

Gets or sets a user name used for authentication on the FTP server.



Oxygene:   property UserName: String read write
C#:   String UserName { get; set; }
VB:   Property UserName As String

Connect (IPAddress, Int32, Binding): Connection     (declared in Client)

Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).


Oxygene:   class method Connect(host: IPAddress; port: Int32; binding: Binding): Connection
C#:   static Connection Connect(IPAddress host, Int32 port, Binding binding)
VB:   Shared Function Connect(host As IPAddress, port As Int32, binding As Binding) As Connection


Parameters:

  • host:
  • port:
  • binding:


Connect (String, Int32, Binding): Connection     (declared in Client)

Overloaded. Use to connect the client to a remote network host using the specified host name (HostName) or IP address (HostAddress) and port number (Port) and/or Binding (BindingV4 or BindingV6).


Oxygene:   class method Connect(hostname: String; port: Int32; binding: Binding): Connection
C#:   static Connection Connect(String hostname, Int32 port, Binding binding)
VB:   Shared Function Connect(hostname As String, port As Int32, binding As Binding) As Connection


Parameters:

  • hostname:
  • port:
  • binding:

constructor

Creates a new instance of the FtpClient class.


Oxygene:   constructor
C#:   constructor()
VB:   Sub New


ChangeDirectory

Changes the current directory to the specified one.

Uses the FTP protocol command CWD.


Oxygene:   method ChangeDirectory(directory: String)
C#:   void ChangeDirectory(String directory)
VB:   Sub ChangeDirectory(directory As String)


Parameters:

  • directory:


ChangeToParentDirectory

Changes the current directory to its parent directory.

Uses the FTP protocol command CDUP.


Oxygene:   method ChangeToParentDirectory
C#:   void ChangeToParentDirectory()
VB:   Sub ChangeToParentDirectory


Close

Closes the connection to the FTP server. This method doesn't send the QUIT FTP command to the server.


Oxygene:   method Close
C#:   void Close()
VB:   Sub Close


Connect (): Connection     (declared in Client)



Oxygene:   method Connect: Connection
C#:   Connection Connect()
VB:   Function Connect As Connection


Connect (IPAddress, Int32): Connection     (declared in Client)



Oxygene:   method Connect(host: IPAddress; port: Int32): Connection
C#:   Connection Connect(IPAddress host, Int32 port)
VB:   Function Connect(host As IPAddress, port As Int32) As Connection


Parameters:

  • host:
  • port:


Connect (String, Int32): Connection     (declared in Client)



Oxygene:   method Connect(hostname: String; port: Int32): Connection
C#:   Connection Connect(String hostname, Int32 port)
VB:   Function Connect(hostname As String, port As Int32) As Connection


Parameters:

  • hostname:
  • port:


ConnectNew (IPAddress, Int32): Connection     (declared in Client)

Overloaded. Opens and returns new connection with specified IP address and port.


Oxygene:   method ConnectNew(host: IPAddress; port: Int32): Connection
C#:   Connection ConnectNew(IPAddress host, Int32 port)
VB:   Function ConnectNew(host As IPAddress, port As Int32) As Connection


Parameters:

  • host:
  • port:


ConnectNew (String, Int32): Connection     (declared in Client)



Oxygene:   method ConnectNew(hostname: String; port: Int32): Connection
C#:   Connection ConnectNew(String hostname, Int32 port)
VB:   Function ConnectNew(hostname As String, port As Int32) As Connection


Parameters:

  • hostname:
  • port:


Delete

Deletes the specified file.

Uses the FTP protocol command DELE.


Oxygene:   method Delete(filename: String)
C#:   void Delete(String filename)
VB:   Sub Delete(filename As String)


Parameters:

  • filename:


GetConnection   protected     (declared in Client)



Oxygene:   method GetConnection(host: IPAddress; port: Int32): Connection
C#:   Connection GetConnection(IPAddress host, Int32 port)
VB:   Function GetConnection(host As IPAddress, port As Int32) As Connection


Parameters:

  • host:
  • port:


GetCurrentDirectory

Returns the name of the current directory.

Uses the FTP protocol command PWD.


Oxygene:   method GetCurrentDirectory: String
C#:   String GetCurrentDirectory()
VB:   Function GetCurrentDirectory As String


List (): String

Returns the list of files in the current working directory.

Uses the FTP protocol command LIST.


Oxygene:   method List: String
C#:   String List()
VB:   Function List As String


List (Boolean): String

Returns the list of files in the current working directory.

Uses the FTP protocol command LIST.


Oxygene:   method List(showHiddenFiles: Boolean): String
C#:   String List(Boolean showHiddenFiles)
VB:   Function List(showHiddenFiles As Boolean) As String


Parameters:

  • showHiddenFiles:


Login

Attempts to login to the remote server using the UserName and Password property values as credentials.


Oxygene:   method Login
C#:   void Login()
VB:   Sub Login


MakeDirectory

Creates a new directory on the remote server.

Uses the FTP protocol command MKD.


Oxygene:   method MakeDirectory(directory: String)
C#:   void MakeDirectory(String directory)
VB:   Sub MakeDirectory(directory As String)


Parameters:

  • directory:


NewConnection   protected     (declared in Client)



Oxygene:   method NewConnection(binding: Binding): Connection
C#:   Connection NewConnection(Binding binding)
VB:   Function NewConnection(binding As Binding) As Connection


Parameters:

  • binding:


Open

Opens a connection to the remote server using the specified HostName or both the HostAddress and Port property values.


Oxygene:   method Open
C#:   void Open()
VB:   Sub Open


Quit

Performs a logout from the remote server.

Uses the FTP protocol command QUIT.


Oxygene:   method Quit
C#:   void Quit()
VB:   Sub Quit


ReleaseConnection   protected     (declared in Client)



Oxygene:   method ReleaseConnection(connection: Connection)
C#:   void ReleaseConnection(Connection connection)
VB:   Sub ReleaseConnection(connection As Connection)


Parameters:

  • connection:


RemoveDirectory (String)

Deletes a directory on the remote server. This method cannot process non-empty directories.

Uses the FTP protocol command RMD.


Oxygene:   method RemoveDirectory(directory: String)
C#:   void RemoveDirectory(String directory)
VB:   Sub RemoveDirectory(directory As String)


Parameters:

  • directory:


RemoveDirectory (String, Boolean)

Deletes a directory on the remote server. This method can not only delete the directory but also its sub-directories and all files they contain.

Uses the FTP protocol command RMD.


Oxygene:   method RemoveDirectory(directory: String; recursive: Boolean)
C#:   void RemoveDirectory(String directory, Boolean recursive)
VB:   Sub RemoveDirectory(directory As String, recursive As Boolean)


Parameters:

  • directory:
  • recursive:


Rename

Renames a file on the remote server.

Uses the FTP protocol commands RNFR and RNTO.


Oxygene:   method Rename(from: String; to: String)
C#:   void Rename(String from, String to)
VB:   Sub Rename(from As String, to As String)


Parameters:

  • from:
  • to:


ResolveHostName   protected     (declared in Client)



Oxygene:   method ResolveHostName
C#:   void ResolveHostName()
VB:   Sub ResolveHostName


ResolveHostNameIfNeeded   protected     (declared in Client)



Oxygene:   method ResolveHostNameIfNeeded
C#:   void ResolveHostNameIfNeeded()
VB:   Sub ResolveHostNameIfNeeded


Retrieve (FtpListingItem, Stream)

Retrieves a file and puts its contents into the provided stream.

Uses the FTP protocol command RETR.


Oxygene:   method Retrieve(item: FtpListingItem; stream: Stream)
C#:   void Retrieve(FtpListingItem item, Stream stream)
VB:   Sub Retrieve(item As FtpListingItem, stream As Stream)


Parameters:

  • item:
  • stream:


Retrieve (String, Int64, Stream)

Retrieves a file and puts its contents into the provided stream.

Uses the FTP protocol command RETR.


Oxygene:   method Retrieve(filename: String; size: Int64; stream: Stream)
C#:   void Retrieve(String filename, Int64 size, Stream stream)
VB:   Sub Retrieve(filename As String, size As Int64, stream As Stream)


Parameters:

  • filename:
  • size:
  • stream:


SendAccount

Sends account information to the remote server.

Account information can be considered as a kind of password that the remote system uses to grant certain privileges. The exact form and meaning of the account information depends on the specific FTP server implementation.

Uses the FTP protocol command ACCT.


Oxygene:   method SendAccount
C#:   void SendAccount()
VB:   Sub SendAccount


SendAndWaitForResponse   protected     (declared in CommandBasedClient)



Oxygene:   method SendAndWaitForResponse(command: String; params validResponses: array of Int32): Boolean
C#:   Boolean SendAndWaitForResponse(String command, params Int32[] validResponses)
VB:   Function SendAndWaitForResponse(command As String, ParamArray validResponses As array of Int32) As Boolean


Parameters:

  • command:
  • validResponses:


SendLog (TransferDirection, String)   protected     (declared in CommandBasedClient)



Oxygene:   method SendLog(direction: TransferDirection; message: String)
C#:   void SendLog(TransferDirection direction, String message)
VB:   Sub SendLog(direction As TransferDirection, message As String)


Parameters:

  • direction:
  • message:


SendLog (TransferDirection, String, array of Object)   protected     (declared in CommandBasedClient)



Oxygene:   method SendLog(direction: TransferDirection; format: String; params parameters: array of Object)
C#:   void SendLog(TransferDirection direction, String format, params Object[] parameters)
VB:   Sub SendLog(direction As TransferDirection, format As String, ParamArray parameters As array of Object)


Parameters:

  • direction:
  • format:
  • parameters:


SetType

Sets the FTP data transfer type to either I (binary type) or A (ascii type).

Uses the FTP protocol command TYPE.


Oxygene:   method SetType(type: String)
C#:   void SetType(String type)
VB:   Sub SetType(type As String)


Parameters:

  • type:


StartActiveConnection

Opens a connection to the remote FTP server in active mode.


Oxygene:   method StartActiveConnection
C#:   void StartActiveConnection()
VB:   Sub StartActiveConnection


StartPassiveConnection

Opens a connection to the remote FTP server in passive mode.


Oxygene:   method StartPassiveConnection
C#:   void StartPassiveConnection()
VB:   Sub StartPassiveConnection


Store

Sends a data stream to the remote server and stores it there as a file.

Uses the FTP protocol command STOR.


Oxygene:   method Store(filename: String; stream: Stream)
C#:   void Store(String filename, Stream stream)
VB:   Sub Store(filename As String, stream As Stream)


Parameters:

  • filename:
  • stream:


TriggerOnBytesReceived   protected



Oxygene:   method TriggerOnBytesReceived(sender: Object; e: EventArgs)
C#:   void TriggerOnBytesReceived(Object sender, EventArgs e)
VB:   Sub TriggerOnBytesReceived(sender As Object, e As EventArgs)


Parameters:

  • sender:
  • e:


TriggerOnNewListing



Oxygene:   method TriggerOnNewListing
C#:   void TriggerOnNewListing()
VB:   Sub TriggerOnNewListing


TriggerOnResolvedHostName   protected     (declared in Client)



Oxygene:   method TriggerOnResolvedHostName(hostname: String; address: IPAddress)
C#:   void TriggerOnResolvedHostName(String hostname, IPAddress address)
VB:   Sub TriggerOnResolvedHostName(hostname As String, address As IPAddress)


Parameters:

  • hostname:
  • address:


TriggerOnResolveHostName   protected     (declared in Client)



Oxygene:   method TriggerOnResolveHostName(var hostname: String)
C#:   void TriggerOnResolveHostName(ref String hostname)
VB:   Sub TriggerOnResolveHostName(ByRef hostname As String)


Parameters:

  • hostname:


TriggerOnTransferStart   protected



Oxygene:   method TriggerOnTransferStart(sender: Object; e: TransferStartEventArgs)
C#:   void TriggerOnTransferStart(Object sender, TransferStartEventArgs e)
VB:   Sub TriggerOnTransferStart(sender As Object, e As TransferStartEventArgs)


Parameters:

  • sender:
  • e:


WaitForResponse   protected     (declared in CommandBasedClient)



Oxygene:   method WaitForResponse(params validResponses: array of Int32): Boolean
C#:   Boolean WaitForResponse(params Int32[] validResponses)
VB:   Function WaitForResponse(ParamArray validResponses As array of Int32) As Boolean


Parameters:

  • validResponses:

OnLog     (declared in CommandBasedClient)



Oxygene:   event OnLog: ClientLogEvent
delegate: method Invoke(sender: Object; e: ClientLogArgs)

C#:   event ClientLogEvent OnLog
delegate: void Invoke(Object sender, ClientLogArgs e)

VB:   Event OnLog As ClientLogEvent
delegate: Sub Invoke(sender As Object, e As ClientLogArgs)


OnNewListing

This event is raised when a file listing is retrieved from the remote server.



Oxygene:   event OnNewListing: EventHandler
C#:   event EventHandler OnNewListing
VB:   Event OnNewListing As EventHandler


OnResolvedHostName     (declared in Client)

This event is fired after the hostname has been successfully resolved.



Oxygene:   event OnResolvedHostName: OnResolvedHostNameHandler
delegate: method Invoke(sender: Object; e: OnResolvedHostNameArgs)

C#:   event OnResolvedHostNameHandler OnResolvedHostName
delegate: void Invoke(Object sender, OnResolvedHostNameArgs e)

VB:   Event OnResolvedHostName As OnResolvedHostNameHandler
delegate: Sub Invoke(sender As Object, e As OnResolvedHostNameArgs)


OnResolveHostName     (declared in Client)

This event is fired before the Client attepts to resolve the sepcifed HostName to an IP address. It provides you with an option to perform the resolution yourself, obtain the IP address from an internal cache you're maintaing, or do some other processing (such as for example chaging the hostname to look up).



Oxygene:   event OnResolveHostName: OnResolveHostNameHandler
delegate: method Invoke(sender: Object; e: OnResolveHostNameArgs)

C#:   event OnResolveHostNameHandler OnResolveHostName
delegate: void Invoke(Object sender, OnResolveHostNameArgs e)

VB:   Event OnResolveHostName As OnResolveHostNameHandler
delegate: Sub Invoke(sender As Object, e As OnResolveHostNameArgs)


OnTransferProgress

This event is raised whenever any data package is sent in any direction.



Oxygene:   event OnTransferProgress: TransferProgressEventHandler
delegate: method Invoke(sender: Object; e: TransferProgressEventArgs)

C#:   event TransferProgressEventHandler OnTransferProgress
delegate: void Invoke(Object sender, TransferProgressEventArgs e)

VB:   Event OnTransferProgress As TransferProgressEventHandler
delegate: Sub Invoke(sender As Object, e As TransferProgressEventArgs)


OnTransferStart

This event is raised before a data transfer between client and remote server is started.



Oxygene:   event OnTransferStart: TransferStartEventHandler
delegate: method Invoke(sender: Object; e: TransferStartEventArgs)

C#:   event TransferStartEventHandler OnTransferStart
delegate: void Invoke(Object sender, TransferStartEventArgs e)

VB:   Event OnTransferStart As TransferStartEventHandler
delegate: Sub Invoke(sender As Object, e As TransferStartEventArgs)


See Also


Product: RemObjects Internet Pack
Available Editions: Internet Pack for .NET

GlossaryArchitectureLibrarySamples