MES Log Download
This commit is contained in:
@@ -9,14 +9,14 @@ namespace DDUtilityApp.MESDOWNLOADER
|
||||
{
|
||||
public static class Util
|
||||
{
|
||||
public static int GetFileMerge(List<string> filePaths)
|
||||
public static string GetFileMerge(List<string> filePaths)
|
||||
{
|
||||
int rtnBint = 9; // 기본 실패 코드
|
||||
string mergedFilePath = string.Empty;
|
||||
|
||||
if (filePaths.Count == 0)
|
||||
{
|
||||
Console.WriteLine("병합할 파일이 없습니다.");
|
||||
return 1;
|
||||
return mergedFilePath;
|
||||
}
|
||||
|
||||
// 실행 시간 측정을 위한 Stopwatch 시작
|
||||
@@ -26,9 +26,10 @@ namespace DDUtilityApp.MESDOWNLOADER
|
||||
// 첫 번째 파일명에서 경로 제외
|
||||
string firstFileName = Path.GetFileName(filePaths.First());
|
||||
string mergedFileName = "merge_" + firstFileName;
|
||||
|
||||
// 병합된 파일을 저장할 경로 (첫 번째 파일과 동일한 폴더)
|
||||
string mergedFilePath = Path.Combine(Path.GetDirectoryName(filePaths.First()), mergedFileName);
|
||||
mergedFilePath = Path.Combine(Path.GetDirectoryName(filePaths.First()), mergedFileName);
|
||||
string extension = Path.GetExtension(mergedFilePath);
|
||||
if (string.Compare(extension, ".Log", true) != 0) mergedFilePath = mergedFilePath + ".Log";
|
||||
|
||||
try
|
||||
{
|
||||
@@ -56,14 +57,14 @@ namespace DDUtilityApp.MESDOWNLOADER
|
||||
Console.WriteLine($"모든 파일이 {mergedFileName}로 병합되었습니다.");
|
||||
Console.WriteLine($"병합 실행 시간: {stopwatch.ElapsedMilliseconds} ms");
|
||||
|
||||
rtnBint = 0; // 성공 코드
|
||||
return mergedFilePath;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"오류 발생: {ex.Message}");
|
||||
}
|
||||
|
||||
return rtnBint;
|
||||
return mergedFilePath;
|
||||
}
|
||||
|
||||
public static string GetStr(object str )
|
||||
|
||||
Reference in New Issue
Block a user