Links

SalFtpClient

PPJ.Runtime.Internet.SalFtpClient
Namespace: PPJ.Runtime.Internet
Assembly: PPJ.Runtime.49 (4.9.0.0)
FTP implementation used to support SalQuickFtp.
C#
VB.NET
public class SalFtpClient : IDisposable
Public Class SalFtpClient
Inherits IDisposable

Constructors

SalFtpClient()

SalFtpClient(server, user, password)

Name
Type
Description
server
String
user
String
password
String

SalFtpClient(server, user, password, port)

Name
Type
Description
server
String
user
String
password
String
port
Int32

Properties

BinaryMode

Boolean: Returns/Sets binary mode transfer.

Connected

Boolean: Returns true if the connection to the server is established.

Password

String: User password.

Port

Int32: Server port number. The default is 21.

Server

String: Name of the FTP server.

User

String: User name.

Methods

AsyncDownload(fileName, localFileName, resume)

Asynchronous download
Parameter
Type
Description
fileName
String
localFileName
String
resume
Boolean

AsyncUpload(fileName, remoteFileName, resume)

Asynchronous upload
Parameter
Type
Description
fileName
String
remoteFileName
String
resume
Boolean

ChangeDir(dir)

Change the current working directory on the remote FTP server.
Parameter
Type
Description
dir
String

Close()

Close the FTP connection.

Connect()

Connect and login to the remote server.

ConnectDataReader()

Creates a new StreamReader bound to an incoming data socket.
Returns: StreamReader.

ConnectDataSocket()

Open a new data socket.
Returns: Socket.

DeleteFile(fileName)

Delete a file from the remote FTP server.
Parameter
Type
Description
fileName
String

Dispose()

Disposes the FTP client

Download(fileName)

Download a file.
Parameter
Type
Description
fileName
String

Download(fileName, resume)

Download a file.
Parameter
Type
Description
fileName
String
resume
Boolean

Download(fileName, localFileName)

Download a file to a local file name.
Parameter
Type
Description
fileName
String
localFileName
String

Download(fileName, localFileName, resume)

Download a file to a local file name.
Parameter
Type
Description
fileName
String
localFileName
String
resume
Boolean

GetCurDir()

Returns the current directory.
Returns: String.

GetFileInfo(mask)

Returns a FileSystemInfo array.
Parameter
Type
Description
mask
String
Returns: FtpFileInfo[].

GetFileList(mask)

Return a string array containing the remote directory's file list.
Parameter
Type
Description
mask
String
Returns: String[].

GetFileSize(fileName)

Return the size of a file.
Parameter
Type
Description
fileName
String
Returns: Int64.

MakeDir(dir)

Create a directory on the remote FTP server.
Parameter
Type
Description
dir
String

ReadResponse()

Reads the next response code from the connected socket.
Returns: FtpResponse.

RemoveDir(dir)

Delete a directory on the remote FTP server.
Parameter
Type
Description
dir
String

RenameFile(oldFileName, newFileName)

Rename a file on the remote FTP server.
Parameter
Type
Description
oldFileName
String
newFileName
String

SendCommand(command, validCodes)

Parameter
Type
Description
command
String
validCodes
Int32[]
Returns: FtpResponse.

Upload(fileName)

Upload a file.
Parameter
Type
Description
fileName
String

Upload(fileName, resume)

Upload a file.
Parameter
Type
Description
fileName
String
resume
Boolean

Upload(fileName, remoteFileName)

Upload a file.
Parameter
Type
Description
fileName
String
remoteFileName
String

Upload(fileName, remoteFileName, resume)

Upload a file.
Parameter
Type
Description
fileName
String
remoteFileName
String
resume
Boolean

Events

StatusUpdate

FtpEventHandler Status event