FtpHelperDownload Method
下載檔案
Namespace: eBizprise.Framework.FtpHelperAssembly: eBizprise.Framework.FtpHelper (in eBizprise.Framework.FtpHelper.dll) Version: 25.0.3.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
public ApiResult<byte[]> Download(
string fileName
)
- fileName String
- 檔案名稱
ApiResultByteApiResult<byte[]>
ApiResult<byte[]> apiResult = new FtpHelper().Download(TargetFile);
if (File.Exists(TargetPath + @"\" + TargetFile))
File.Delete(TargetPath + @"\" + TargetFile);
using FileStream outputStream = new FileStream(TargetPath + "\\" + TargetFile, FileMode.Create);
outputStream.Write(apiResult.Result, 0, apiResult.Result.Length);
Assert.IsTrue(apiResult.IsSuccess, "讀取失敗");
| Date | Version | Description |
|---|
| 2021/06/08 | 1.0.0.0 | 初版 |
| 2021/07/21 | 1.0.1.0 | 調整連接埠設定資料類型為int |
| 2025/09/19 | 25.0.0.0 | 彙整2025年度初版 |
| 2025/11/24 | 25.0.2.0 | 調整設定值可由設定檔取得或自訂 |
| 2025/11/27 | 25.0.3.0 | 改用FluentFTP重構,移除已過時的FtpWebRequest |