BFTPClient
Identità
Namespace:
B.BNetAssembly:
BFrameworkTipo: class
Interfacce:
IDisposableSorgente API: versione
5.0.0
Scopo
Client FTP/FTPS sincrono e asincrono per listing, trasferimento, eliminazione e dimensione dei file. Espone diagnostica tramite ExceptionList e LogText.
Dichiarazione
public class BFTPClient : IDisposable
Costruttori
BFTPClient()BFTPClient(string host, int port, string username, string password, bool useSSL = false, bool useImplicitSSL = false, bool protectDataChannel = true, bool acceptAllCertificates = false, int timeout = 10000, Encoding? encoding = null)
Proprietà
| Proprietà | Tipo | Accesso |
|---|---|---|
AcceptAllCertificates |
bool |
get/set |
ControlEncoding |
Encoding |
get/set |
ExceptionList |
List<Exception> |
get/set |
Host |
string |
get/set |
IsConnected |
bool |
get |
LogText |
BLogText |
get |
Port |
int |
get/set |
ProtectDataChannel |
bool |
get/set |
Timeout |
int |
get/set |
UseImplicitSSL |
bool |
get/set |
UseSSL |
bool |
get/set |
Metodi
bool Connect(string host, int port = 21)Task<bool> ConnectAsync(string host, int port = 21)bool DeleteFile(string remotePath)Task<bool> DeleteFileAsync(string remotePath)void Disconnect()void Dispose()BFile? DownloadFile(string remotePath)bool DownloadFile(string remotePath, string localPath)byte[]? DownloadFile(string remotePath, bool AsByte)Task<BFile> DownloadFileAsBFileAsync(string remotePath)Task<byte[]> DownloadFileAsync(string remotePath)Task<bool> DownloadFileAsync(string remotePath, string localPath)long GetFileSize(string remotePath)Task<long> GetFileSizeAsync(string remotePath)List<string>? ListDirectory(string path = "")Task<List<string>> ListDirectoryAsync(string path = "")bool Login(string username, string password)Task<bool> LoginAsync(string username, string password)List<BFtpItem>? ReadDirectory(string path = "")Task<List<BFtpItem>> ReadDirectoryAsync(string path = "")bool UploadFile(string localPath, string remotePath)bool UploadFile(byte[] content, string remotePath)bool UploadFile(BFile file, string remotePath)Task<bool> UploadFileAsync(string localPath, string remotePath)Task<bool> UploadFileAsync(byte[] content, string remotePath)Task<bool> UploadFileAsync(BFile file, string remotePath)
Esempi
Consultare BFTPClient - Esempi.
