EquipmentList.OrderBy

This commit is contained in:
2025-03-05 11:07:18 +09:00
parent fb46e2b17a
commit f92e560e87
6 changed files with 168 additions and 61 deletions

View File

@@ -50,8 +50,19 @@ namespace JWH.NETWORK
public static bool IsFileExists(string path)
{
Connect();
return _sftpClient.Exists(path);
try
{
Connect();
return _sftpClient.Exists(path);
}
catch
{
return false;
}
finally
{
Disconnect();
}
}
public static Renci.SshNet.Sftp.SftpFileAttributes GetFileInfo(string remoteFilePath)
@@ -74,12 +85,27 @@ namespace JWH.NETWORK
Console.WriteLine($"파일 정보 조회 오류: {ex.Message}");
return null;
}
finally
{
Disconnect();
}
}
public static object GetSftpList(string path)
{
Connect();
return _sftpClient.ListDirectory(path);
try
{
Connect();
return _sftpClient.ListDirectory(path);
}
catch (Exception ex)
{
throw ex;
}
finally
{
Disconnect();
}
}
public static bool DownloadSftpFile(string remotePath, string localPath)
@@ -98,6 +124,10 @@ namespace JWH.NETWORK
Console.WriteLine($"Download error: {ex.Message}");
return false;
}
finally
{
Disconnect();
}
}
public static bool UploadSftpFile(string localPath, string remotePath)
@@ -116,6 +146,10 @@ namespace JWH.NETWORK
Console.WriteLine($"Upload error: {ex.Message}");
return false;
}
finally
{
Disconnect();
}
}
}
}