C# Класс CoreTechs.Sftp.Client.Sftp

Wrapper class for 'Renci.SshNet' SFTP client.
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
CreateRemoteDirectory string
CreateSftpClient Renci.SshNet.SftpClient
DoesRemoteFileExist bool
UploadFile void
UploadFile void

Открытые методы

Метод Описание
UploadFile ( string fileName, bool overwrite = false, string remoteDirectoryPath = null ) : void

Upload a file to the SFTP server specified in the public properties.

Assumption: the public properties (Host, Username, Password and Hostkey) have been initialized before calling this method.

UploadFile ( string sftpConnectionString, string fileName, bool overwrite = false, string remoteDirectoryPath = null ) : void

Upload a file to the SFTP server specified in the connection string.

The SFTP connection string is in the form: "username=USERNAME;password=PASSWORD;host=HOSTNAME;hostkey=ssh-dss 1024 9b:3f:14:6a:6f:36:7f:b7:58:f4:e4:89:0d:3f:c2:26".

UploadFiles ( string localPath, string searchPattern, bool overwrite = false, string remoteDirectoryPath = null ) : void

Upload file(s) to the SFTP server specified in the public properties.

Assumption: the public properties (Host, Username, Password and Hostkey) have been initialized before calling this method.

UploadFiles ( string sftpConnectionString, string localPath, string searchPattern, bool overwrite = false, string remoteDirectoryPath = null ) : void

Upload file(s) to the SFTP server specified in the connection string.

The SFTP connection string is in the form: "username=USERNAME;password=PASSWORD;host=HOSTNAME;hostkey=ssh-dss 1024 9b:3f:14:6a:6f:36:7f:b7:58:f4:e4:89:0d:3f:c2:26".

Приватные методы

Метод Описание
CreateRemoteDirectory ( SftpClient sftp, string fileName, string remoteDirectoryPath ) : string
CreateSftpClient ( this connectionString ) : SftpClient
DoesRemoteFileExist ( this sftp, string path ) : bool
UploadFile ( this sftp, FileInfo file, bool overwrite = false, string remoteDirectoryPath = null ) : void
UploadFile ( this sftp, string fileName, bool overwrite = false, string remoteDirectoryPath = null ) : void

Описание методов

UploadFile() публичный статический Метод

Upload a file to the SFTP server specified in the public properties.
Assumption: the public properties (Host, Username, Password and Hostkey) have been initialized before calling this method.
public static UploadFile ( string fileName, bool overwrite = false, string remoteDirectoryPath = null ) : void
fileName string Name of file to upload.
overwrite bool Overwrite the file on the SFTP server if it already exists ? (default=false)
remoteDirectoryPath string Target path on remote server. (default=null)
Результат void

UploadFile() публичный статический Метод

Upload a file to the SFTP server specified in the connection string.
The SFTP connection string is in the form: "username=USERNAME;password=PASSWORD;host=HOSTNAME;hostkey=ssh-dss 1024 9b:3f:14:6a:6f:36:7f:b7:58:f4:e4:89:0d:3f:c2:26".
public static UploadFile ( string sftpConnectionString, string fileName, bool overwrite = false, string remoteDirectoryPath = null ) : void
sftpConnectionString string Connection string for a SFTP server.
fileName string Name of file to upload.
overwrite bool Overwrite the file on the SFTP server if it already exists ? (default=false)
remoteDirectoryPath string Target path on remote server. (default=null)
Результат void

UploadFiles() публичный статический Метод

Upload file(s) to the SFTP server specified in the public properties.
Assumption: the public properties (Host, Username, Password and Hostkey) have been initialized before calling this method.
public static UploadFiles ( string localPath, string searchPattern, bool overwrite = false, string remoteDirectoryPath = null ) : void
localPath string Path to upload from.
searchPattern string Wildcard pattern to use to find files (e.g., "*.txt")
overwrite bool Overwrite the file on the SFTP server if it already exists ? (default=false)
remoteDirectoryPath string Target path on remote server. (default=null)
Результат void

UploadFiles() публичный статический Метод

Upload file(s) to the SFTP server specified in the connection string.
The SFTP connection string is in the form: "username=USERNAME;password=PASSWORD;host=HOSTNAME;hostkey=ssh-dss 1024 9b:3f:14:6a:6f:36:7f:b7:58:f4:e4:89:0d:3f:c2:26".
public static UploadFiles ( string sftpConnectionString, string localPath, string searchPattern, bool overwrite = false, string remoteDirectoryPath = null ) : void
sftpConnectionString string Connection string for a SFTP server.
localPath string Path to upload from.
searchPattern string Wildcard pattern to use to find files (e.g., "*.txt")
overwrite bool Overwrite the file on the SFTP server if it already exists ? (default=false)
remoteDirectoryPath string Target path on remote server. (default=null)
Результат void