The Sftp type exposes the following members.

Constructors

  Name Description
Public method Sftp()()()()
Creates a new SFTP client instance.
Public method Sftp(DirectoryInfo)
Creates a new SFTP client instance
Public method Sftp(SshParameters)
Creates a new SFTP client instance with current application directory.
Public method Sftp(SshParameters, DirectoryInfo)
Creates a new SFTP client instance
Public method Sftp(String, String, String)
Creates a new SFTP client instance with defaut SSH port(22) and current application directory.
Public method Sftp(String, String, String, DirectoryInfo)
Creates a new SFTP client instance with defaut SSH port(22).

Methods

  Name Description
Public method AddProtocol
Adds the protocol instance to the client.
Public method Connect
Establishes the connection with SFTP server.
Public method DeleteDir(String)
Deletes directory from SFTP server.
Public method DeleteDir(String, Boolean)
Deletes directory from SFTP server.
Public method DeleteFile
Deletes file from SFTP server.
Public method Disconnect
Disconnects from the remote host.
Public method Download(String)
Downloads the specified file and stores in the current local directory.
Public method Download(Stream, String)
Downloads the specified file to the output stream.
Public method Download(String, String)
Downloads the specified remote file and stores as specified local file in current local directory.
Public method DownloadDir
Downloads the remote directory.
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected method Finalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public method GetDirListing()()()()
Returns the remote directory entries enumerator.
Public method GetDirListing(String)
Returns the remote directory entries enumerator.
Public method GetDirListing(String, RegexOptions)
Returns the remote directory entries enumerator.
Public method GetDirListingAsString()()()()
Returns the remote directory content packed in one string.
Public method GetDirListingAsString(String)
Returns the remote directory content packed in one string.
Public method GetDirListingAsString(String, RegexOptions)
Returns the remote directory content packed in one string.
Public method GetFilePermissions
Gets remote file permissions in UNIX chmod format (644, 777).
Public method GetFileSize
Returns the file size in bytes.
Public method GetFileTimestamp
Returns the file modification time as DateTime object.
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetInputStream
Gets an
CopyC#
InputStream
from SSH server for the purposes of downloading a file.
Public method GetLocalDirListing()()()()
Gets local directory listing.
Public method GetLocalDirListing(String)
Gets local directory listing.
Public method GetNameListing()()()()
Returns the remote directory content names enumerator.
Public method GetNameListing(String)
Returns the remote directory content names enumerator.
Public method GetOutputStream
Gets an
CopyC#
Stream
from SSH server for the purposes of uploading a file.
Public method GetRealPath
Returns real server path.
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IsValidPath
Checks if path is valid, i.e. denotes existing file or directory.
Public method MakeDir
Creates remote directory.
Public method MakeLocalDir
Creates a local directory. Directory is relative to current local directory.
Public method Mdownload(IEnumerator)
Downloads multiple files.
Public method Mdownload(String)
Downloads multiple files.
Public method Mdownload(String, RegexOptions)
Downloads multiple files.
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public method Mupload(IEnumerator)
Uploads multiple files.
Public method Mupload(String)
Uploads multiple files.
Public method RemoveProtocol
Removes the protocol from the client.
Public method RenameFile
Renames remote file on SFTP server.
Public method ResumeDownload(String, Int64)
Resumes the file download.
Public method ResumeDownload(String, String, Int64)
Resumes the file download.
Public method ResumeUpload(FileInfo, Int64)
Resumes the file upload.
Public method ResumeUpload(String, Int64)
Resumes the file upload.
Public method SetAutoMode
Sets the transfer mode to auto. Transfer mode will be automatically detected based on file extension and MIME type.
Public method SetBinaryMode
Sets the transfer mode to binary.
Public method SetFilePermissions
Sets file permissions.
Public method SetTextMode
Sets the transfer mode to ASCII. This method works with servers supporting sftp protocol version 4 and above.
Protected method Sftp_Closed
Public method ToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public method Upload(FileInfo)
Uploads the specified file.
Public method Upload(String)
Uploads the specified file.
Public method Upload(array<Byte>[]()[][], String)
Uploads the specified data to the remote file.
Public method Upload(FileInfo, String)
Uploads the specified file.
Public method Upload(String, Boolean)
Uploads the specified file.
Public method Upload(String, String)
Uploads the specified file.
Public method Upload(array<Byte>[]()[][], String, Boolean)
Uploads the specified data to the remote file.
Public method Upload(FileInfo, String, Boolean)
Uploads the specified file.
Public method Upload(String, String, Boolean)
Uploads the specified file.
Public method UploadDir
Uploads the specified directory.

Properties

  Name Description
Public property Configuration
SSH connection configuration.
Public property CurrentVersion
The current protocol version.
Public property Debug
The client debug flag.
Public property DebugStream
The debug stream.
Public property DownloadingBufferSize
The downloading buffer size in bytes. Set to 0 for adaptive buffer size.
Public property HostKeys
Gets SSH host keys for further use.
Public property Hostname
The target server hostname.
Public property Interrupted
The current transfer state.
Public property IsConnected
Checks if the client is currently connected to the server.
Public property LicenseKey
License key.
Public property LineTerminator
Line terminator for text mode transfer.
Public property LocalDir
The local directory.
Public property Parameters
SSH parameters.
Public property Password
The current user password.
Public property Port
The target server port.
Public property PrivateKey
The current user key file.
Public property ReaderEncoding
Gets or sets the reader character encoding.
Public property RemoteDir
The remote directory.
Public property TargetVersion
The preffered protocol version.
Public property Timeout
The connection timeout defined in milliseconds.
Public property UploadingBufferSize
The uploading buffer size in bytes. Set to 0 for adaptive buffer size.
Public property UseAdaptiveConnect
Adaptive connection flag. If true adaptive connection will be taken in use.
Public property Username
The current username.
Public property WriterEncoding
Gets or sets the writer character encoding.

Events

  Name Description
Public event SftpConnectedEvent
Occurs after a successful connection to the SSH server.
Public event SftpDisconnectedEvent
Occurs after disconnecting from the SSH server.
Public event SftpDownloadEvent
Occurs after a file is downloaded.
Public event SftpListingEvent
Occurs after a remote directory listing is performed.
Public event SftpProgressEvent
Occurs periodically during a file transfer to mark it's progress.
Public event SftpUploadEvent
Occurs after a file is uploaded.

See Also