소스 검색

现有log输出,无法区分是哪个串口的。

sat23 3 년 전
부모
커밋
94f8bfbf8e
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      SCBC Factory Tools/LogHelper/Writelog.cs

+ 5 - 1
SCBC Factory Tools/LogHelper/Writelog.cs

@@ -61,7 +61,11 @@ namespace SXLibrary
 
                     Monitor.Enter(FileLock);
 
-                    string _path = FilePath + msg.Substring(0, 5).Trim() + "\\" + DateTime.Now.ToString("yyyy-MM");
+                    string _path;
+                    if ( msg.StartsWith("COM") )
+                        _path = FilePath + msg.Substring(0, 10).Trim() + "\\" + DateTime.Now.ToString("yyyy-MM");
+                    else
+                        _path = FilePath + msg.Substring(0, 5).Trim() + "\\" + DateTime.Now.ToString("yyyy-MM");
 
                     if (!Directory.Exists(_path))
                     {