从FTP服务器下载文件到本地文件,支持进度汇报和取消操作
Download files from an FTP server to local files, with support for progress reporting and cancellation operations.
命名空间:
HslCommunication.Enthernet.Ftp
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.5.3.0 (12.5.3.0)
语法public OperateResult DownloadFile(
string remoteFile,
string localFile,
Action<long, long> processReport = null,
HslCancelToken cancelToken = null
)
Public Function DownloadFile (
remoteFile As String,
localFile As String,
Optional processReport As Action(Of Long, Long) = Nothing,
Optional cancelToken As HslCancelToken = Nothing
) As OperateResult
public:
OperateResult^ DownloadFile(
String^ remoteFile,
String^ localFile,
Action<long long, long long>^ processReport = nullptr,
HslCancelToken^ cancelToken = nullptr
)
member DownloadFile :
remoteFile : string *
localFile : string *
?processReport : Action<int64, int64> *
?cancelToken : HslCancelToken
(* Defaults:
let _processReport = defaultArg processReport null
let _cancelToken = defaultArg cancelToken null
*)
-> OperateResult
参数
- remoteFile
- 类型:SystemString
服务器的文件,例如 /A/123.txt - localFile
- 类型:SystemString
本地保存的文件名 - processReport (Optional)
- 类型:SystemActionInt64, Int64
进度报告 - cancelToken (Optional)
- 类型:HslCommunication.CoreHslCancelToken
取消操作
返回值
类型:
OperateResult是否下载成功
参见