FtpHelperDownload Method

下載檔案

Definition

Namespace: eBizprise.Framework.FtpHelper
Assembly: eBizprise.Framework.FtpHelper (in eBizprise.Framework.FtpHelper.dll) Version: 25.0.3.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
C#
public ApiResult<byte[]> Download(
	string fileName
)

Parameters

fileName  String
檔案名稱

Return Value

ApiResultByte
ApiResult<byte[]>

Example

C#
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, "讀取失敗");

Revision History

DateVersionDescription
2021/06/081.0.0.0初版
2021/07/211.0.1.0調整連接埠設定資料類型為int
2025/09/1925.0.0.0彙整2025年度初版
2025/11/2425.0.2.0調整設定值可由設定檔取得或自訂
2025/11/2725.0.3.0改用FluentFTP重構,移除已過時的FtpWebRequest

See Also