集成mes接口,请求-响应-错误处理

This commit is contained in:
liming 蔡
2026-07-14 17:13:01 +08:00
parent 2ecfd549b3
commit 8c6c9a5dc1
6 changed files with 26 additions and 9 deletions
+7 -2
View File
@@ -95,6 +95,7 @@ namespace JYControl
_manager.listView1.EndUpdate();
string fileName = $"{DateTime.Now.ToString("yyyyMMdd")}.txt";
switch (logAddtype)
{
case LogAddtype.MES:
@@ -102,7 +103,9 @@ namespace JYControl
{
Directory.CreateDirectory(logMesPath);
}
using (StreamWriter sw = new StreamWriter(logMesPath+DateTime.Now.ToString("yyyyMMdd") + ".txt", true))
string logMesFilePath = Path.Combine(logMesPath, fileName);
using (StreamWriter sw = new StreamWriter(logMesFilePath, true))
{
sw.WriteLine(strDate + " " + logType.ToString() + " " + strLog);
}
@@ -112,7 +115,9 @@ namespace JYControl
{
Directory.CreateDirectory(loglocalPath);
}
using (StreamWriter sw = new StreamWriter(loglocalPath+DateTime.Now.ToString("yyyyMMdd") + ".txt", true))
string loglocalFilePath = Path.Combine(loglocalPath, fileName);
using (StreamWriter sw = new StreamWriter(loglocalFilePath, true))
{
sw.WriteLine(strDate + " " + logType.ToString() + " " + strLog);
}