This commit is contained in:
梁骏愉
2025-02-10 09:24:44 +08:00
parent 3d15fd4b7e
commit 17bb7e4131
56 changed files with 15484 additions and 502 deletions

View File

@@ -91,7 +91,7 @@ namespace HandleUtils
/// </summary>
/// <param name="localPath">本地路径</param>
/// <param name="remotePath">远程路径</param>
public void Put(string localPath, string remotePath, Action<ulong> action = null)
public void Put(string localPath, string remotePath, string msg = "", Action<ulong> action = null)
{
try
{
@@ -99,12 +99,14 @@ namespace HandleUtils
{
Connect();
_sftp.UploadFile(file, remotePath, action);
msg = "上传成功!";
}
}
catch (Exception ex)
{
// TxtLog.WriteTxt(CommonMethod.GetProgramName(), string.Format("SFTP文件上传失败原因{0}", ex.Message));
throw new Exception(string.Format("SFTP文件上传失败原因{0}", ex.Message));
//throw new Exception(string.Format("SFTP文件上传失败原因{0}", ex.Message));
msg = ex.Message;
}
finally
{