Skip to main content

SalQuickFTP

Namespace: PPJ.Runtime.Windows.QO

Assembly: PPJ.Runtime.50 (5.0.0.0)

Exposes FTP connection, listing, and transfers through a Quick Objects control.

public class SalQuickFTP : SalCustomControl

Example:

using PPJ.Runtime.Windows.QO;

var control = new SalQuickFTP();
control.ServerName = "ftp.example.com";

Constructors

Instance member SalQuickFTP()

Initializes the FTP compatibility control.

Properties

Instance member AppName

String: Gets or sets the application-name compatibility value. (Default: "")

SalQuickHTTP uses it as the user agent when its client is first created. SalQuickFTP stores it without applying it.

Instance member FtpClient

SalFtpClient: Gets the lazily created FTP client.

First access sends QOM_ControlCreate and attaches status-message forwarding.

Instance member Password

String: Gets or sets the stored FTP password. (Default: "")

Connect receives its own credentials and updates this value after success.

Instance member ServerName

String: Gets or sets the stored FTP server name. (Default: "")

Changing it does not connect or reconfigure an active client.

Instance member ServerPort

Int32: Gets or sets the stored FTP port. (Default: 21)

Connect receives its own port and updates this value after success.

Instance member UserName

String: Gets or sets the stored FTP login name. (Default: "")

Connect receives its own credentials and updates this value after success.

Instance member WindowsClassName

String: Gets the fixed native window-class name compatibility value. (Default: "")

Returns an empty string; assignments throw InvalidOperationException.

Instance member WindowsDLLName

String: Gets the fixed native library name compatibility value. (Default: "")

Returns an empty string; assignments throw InvalidOperationException.

Instance member WindowsExStyle

Int32: Gets the fixed extended native window style compatibility value. (Default: 0)

Returns zero; assignments throw InvalidOperationException.

Instance member WindowsStyle

Int32: Gets the fixed native window style compatibility value. (Default: 0)

Returns zero; assignments throw InvalidOperationException.

Methods

Instance member CloseFile(hFile)

Accepts the remote-file close compatibility request.

ParameterTypeDescription
hFileSalNumberReserved compatibility argument; ignored or unchanged.

Returns: SalNumber. Zero.

Logs that the operation is unimplemented and leaves all outputs unchanged.

Instance member Connect(sServerName, nServerPort, sUserName, sPassword)

Connects and logs in to the requested FTP server.

ParameterTypeDescription
sServerNameSalStringThe FTP host name or address.
nServerPortSalNumberThe port; nonpositive values select 21.
sUserNameSalStringThe login name, or empty for anonymous.
sPasswordSalStringThe password, or empty for the anonymous default.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

Empty credentials use the anonymous defaults. A nonpositive port selects port 21 on the client; stored properties retain supplied values.

Instance member CreateDirectory(sDirectory)

Creates a remote directory.

ParameterTypeDescription
sDirectorySalStringThe remote directory path.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

Null or empty paths make no change.

Instance member DeleteFile(sRemoteFile)

Deletes a remote file.

ParameterTypeDescription
sRemoteFileSalStringThe remote file path.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

Handled client errors are retained for the last-error getters.

Instance member Disconnect()

Closes the FTP control connection.

Returns: SalNumber. Zero after closing.

Client exceptions from Close propagate.

Protected member Dispose(disposing)

Disconnects the FTP client before releasing base control resources.

ParameterTypeDescription
disposingBooleanWhether managed resources are being disposed.

Instance member EnumDirectories(sSearch, sDirs)

Replaces the output array with matching remote directory names.

ParameterTypeDescription
sSearchSalStringThe server-side listing pattern.
sDirsSalArray<SalString>Receives matching directories in a reset dynamic array.

Returns: SalNumber. The directory count, or the negated client error code.

Instance member EnumFiles(sSearchFile, saFileNames)

Replaces the output array with names from an FTP NLST listing.

ParameterTypeDescription
sSearchFileSalStringThe server-side listing pattern.
saFileNames by referenceSalArray<SalString>Receives names in a reset dynamic array.

Returns: SalNumber. The returned-name count, or the negated client error code.

Instance member EnumFilesInfo(sSearchFile, saFileNames, naAttributes, dtaCreationTimes, dtaLastAccessTimes, dtaLastWriteTimes, naFileSizes)

Replaces parallel arrays with remote listing information.

ParameterTypeDescription
sSearchFileSalStringThe server-side listing pattern.
saFileNamesSalArray<SalString>Receives names in a reset dynamic array.
naAttributesSalArray<SalNumber>Receives directory or normal-file attributes.
dtaCreationTimesSalArray<SalDateTime>Receives DateTime.MinValue for each entry.
dtaLastAccessTimesSalArray<SalDateTime>Receives listed modification times.
dtaLastWriteTimesSalArray<SalDateTime>Receives listed modification times.
naFileSizesSalArray<SalNumber>Receives listed byte sizes.

Returns: SalNumber. The entry count, or the negated client error code.

Creation times are DateTime.MinValue; access and write times both use the listing modification time. Attributes indicate only directory or normal file.

Instance member FindFirstFile(sSearchFile, sFileName)

Starts a listing and selects the first non-directory entry with positive size.

ParameterTypeDescription
sSearchFileSalStringThe server-side listing pattern.
sFileName by referenceSalStringReceives the matched name when an entry is available.

Returns: SalNumber. Zero when the output contains a name; ERROR_NO_MORE_FILES if it remains empty; -1 when no eligible entry remains or a client error is handled.

An empty listing leaves the output unchanged; its existing length affects the result.

Instance member FindFirstFileInfo(sSearchFile, sFileName, nAttributes, dtCreationTime, dtLastAccessTime, dtLastWriteTime, nFileSize)

Starts a listing and returns its first entry.

ParameterTypeDescription
sSearchFileSalStringThe server-side listing pattern.
sFileName by referenceSalStringReceives the matched name when an entry is available.
nAttributes by referenceSalNumberReceives directory or normal-file attributes.
dtCreationTime by referenceSalDateTimeReceives DateTime.MinValue.
dtLastAccessTime by referenceSalDateTimeReceives the listing modification time.
dtLastWriteTime by referenceSalDateTimeReceives the listing modification time.
nFileSize by referenceSalNumberReceives the listed byte size.

Returns: SalNumber. Zero after retrieving the listing, including an empty listing; otherwise the negated client error code.

An empty listing leaves outputs unchanged.

Instance member FindNextFile(sFileName)

Returns the next non-directory name from the current listing.

ParameterTypeDescription
sFileName by referenceSalStringReceives the matched name when an entry is available.

Returns: SalNumber. Zero for an entry, or -1 when exhausted.

Requires a listing initialized by FindFirst. Unlike FindFirstFile, zero-length files are not skipped.

Instance member FindNextFileInfo(sFileName, nAttributes, dtCreationTime, dtLastAccessTime, dtLastWriteTime, nFileSize)

Returns information for the next current-listing entry.

ParameterTypeDescription
sFileName by referenceSalStringReceives the matched name when an entry is available.
nAttributes by referenceSalNumberReceives directory or normal-file attributes.
dtCreationTime by referenceSalDateTimeReceives DateTime.MinValue.
dtLastAccessTime by referenceSalDateTimeReceives the listing modification time.
dtLastWriteTime by referenceSalDateTimeReceives the listing modification time.
nFileSize by referenceSalNumberReceives the listed byte size.

Returns: SalNumber. Zero for an entry, or -1 if no current entry exists.

Instance member GetCurrentDirectory(sDirectory)

Reads the current remote directory into the output string.

ParameterTypeDescription
sDirectory by referenceSalStringReceives the current remote directory on success.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

The output is unchanged on a handled client error.

Instance member GetFile(sRemoteFile, sLocalFile, bTransferBinary, nContext)

Downloads a remote file with resume enabled.

ParameterTypeDescription
sRemoteFileSalStringThe remote file path.
sLocalFileSalStringThe local file path.
bTransferBinarySalBooleanTrue for binary mode; false for text mode.
nContextSalNumberZero to wait; any nonzero value to start asynchronously.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

Sets the transfer mode. A nonzero context starts an asynchronous transfer and returns before completion.

Instance member GetLastErrorCode()

Reads the negated code from the last handled FTP exception.

Returns: SalNumber. The stored negated error code.

Successful calls do not clear it.

Instance member GetLastErrorMessage()

Reads the last handled FTP exception message.

Returns: SalString. The stored message.

Successful calls do not clear it.

Instance member OpenFile(sRemoteFile, nFlags, bFlags)

Accepts the remote-file open compatibility request.

ParameterTypeDescription
sRemoteFileSalStringReserved compatibility argument; ignored or unchanged.
nFlagsSalNumberReserved compatibility argument; ignored or unchanged.
bFlagsSalBooleanReserved compatibility argument; ignored or unchanged.

Returns: SalNumber. Zero.

Logs that the operation is unimplemented and leaves all outputs unchanged.

Instance member PutFile(sLocalFile, sRemoteFile, bBinaryTransfer, nContext)

Uploads a local file, optionally starting asynchronously.

ParameterTypeDescription
sLocalFileSalStringThe local file path.
sRemoteFileSalStringThe remote file path.
bBinaryTransferSalBooleanTrue for binary mode; false for text mode.
nContextSalNumberZero to wait; any nonzero value to start asynchronously.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

Sets the transfer mode, uses the local base name for an empty remote name, and attempts to delete the remote file before upload. A nonzero context only selects asynchronous execution.

Instance member ReadFile(hFile, sBuffer, nBufferSize)

Accepts the remote-file read compatibility request.

ParameterTypeDescription
hFileSalNumberReserved compatibility argument; ignored or unchanged.
sBuffer by referenceSalStringReserved compatibility argument; ignored or unchanged.
nBufferSizeSalNumberReserved compatibility argument; ignored or unchanged.

Returns: SalNumber. Zero.

Logs that the operation is unimplemented and leaves all outputs unchanged.

Instance member RemoveDirectory(sDirectory)

Removes a remote directory.

ParameterTypeDescription
sDirectorySalStringThe remote directory path.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

Null or empty paths make no change.

Instance member RenameFile(sOldRemoteFile, sNewRemoteFile)

Renames a remote file.

ParameterTypeDescription
sOldRemoteFileSalStringThe existing remote name.
sNewRemoteFileSalStringThe replacement remote name.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

Handled client errors are retained for the last-error getters.

Protected member SetBoundsCore(x, y, width, height, specified)

Applies the requested position while fixing the control size at 33 by 33 pixels.

ParameterTypeDescription
xInt32The left coordinate.
yInt32The top coordinate.
widthInt32The requested width; replaced with 33.
heightInt32The requested height; replaced with 33.
specifiedBoundsSpecifiedThe bounds components being changed.

Instance member SetCurrentDirectory(sDirectory)

Changes the current remote directory.

ParameterTypeDescription
sDirectorySalStringThe remote directory path.

Returns: SalNumber. Zero on completion; the negated client error code when a client exception is handled. Cancellation with code zero also returns zero.

Null, empty, and dot paths make no change.

Instance member WriteFile(hFile, sBuffer, nBufferSize)

Accepts the remote-file write compatibility request.

ParameterTypeDescription
hFileSalNumberReserved compatibility argument; ignored or unchanged.
sBufferSalStringReserved compatibility argument; ignored or unchanged.
nBufferSizeSalNumberReserved compatibility argument; ignored or unchanged.

Returns: SalNumber. Zero.

Logs that the operation is unimplemented and leaves all outputs unchanged.

Implements

NameDescription
ISalWindowExposes SAL message dispatch and runtime metadata for child controls, forms, dialogs, and MDI windows.