1
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user