From 617bcd2ae4d586a6252c9975fa17e2e5d6a41399 Mon Sep 17 00:00:00 2001 From: "nodyang@aliyun.com" Date: Wed, 25 Dec 2024 15:57:13 +0800 Subject: [PATCH] reslt --- HighWayIot.Plc/PlcConnect.cs | 4 ++-- HighWayIot.Winform/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HighWayIot.Plc/PlcConnect.cs b/HighWayIot.Plc/PlcConnect.cs index 7c71b05..fc4af51 100644 --- a/HighWayIot.Plc/PlcConnect.cs +++ b/HighWayIot.Plc/PlcConnect.cs @@ -36,8 +36,8 @@ namespace HighWayIot.Plc SocketKeepAliveTime = -1, IsPersistentConnection = true, }; - var a = plc.ConnectServer(); - logHelper.Info($"Plc连接 信息:[{a.Message}] 是否成功:[{a.IsSuccess.ToString()}] 错误代码:[{a.ErrorCode}]"); + var reslt = plc.ConnectServer(); + logHelper.Info($"Plc连接 信息:[{reslt.Message}] 是否成功:[{reslt.IsSuccess.ToString()}] 错误代码:[{reslt.ErrorCode}]"); if (!reslt.IsSuccess) { logHelper.Info("链接失败:"+reslt.Message); diff --git a/HighWayIot.Winform/Program.cs b/HighWayIot.Winform/Program.cs index 72ee4ff..30a819c 100644 --- a/HighWayIot.Winform/Program.cs +++ b/HighWayIot.Winform/Program.cs @@ -31,7 +31,7 @@ namespace HighWayIot.Winform //Console.OutputEncoding = System.Text.Encoding.UTF8; //Console.InputEncoding = System.Text.Encoding.UTF8; - var b= PlcConnect.IsConnect; + AllocConsole();//调用系统API,调用控制台窗口 // 设置控制台编码为系统默认编码(解决乱码问题)