更新
This commit is contained in:
@@ -81,7 +81,7 @@ namespace WindowsFormsApp6
|
||||
_readTimer.Tick += ReadTimer_Tick;
|
||||
|
||||
// 尝试打开默认串口
|
||||
if (!TryOpenSerialPort("COM14"))
|
||||
if (!TryOpenSerialPort("COM3"))
|
||||
{
|
||||
// 如果默认串口失败,弹出端口选择对话框
|
||||
ShowPortSelectionDialog();
|
||||
@@ -128,7 +128,8 @@ namespace WindowsFormsApp6
|
||||
// 启动定时读取
|
||||
_readTimer.Start();
|
||||
|
||||
ShowInfoMsg($"串口 {portName} 初始化成功");
|
||||
// 串口初始化成功,直接返回,不显示提示框
|
||||
System.Diagnostics.Debug.WriteLine($"串口 {portName} 初始化成功");
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user