資源簡介
wpf實現的上位機 Modbus協議 ,包括 5格精美信號強度顯示-和自定義實現彈窗非系統彈窗。
但程序編譯為x86模式請注意。
開發環境為 visual studio 2019
wpf c#
win10 64位 。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Configuration;
using?System.Data;
using?System.Linq;
using?System.Windows;
using?EMS2.Utility;
using?CalibrateUnility;
namespace?AirConfig
{
????///?
????///?App.xaml?的交互邏輯
????///?
????public?partial?class?App?:?Application
????{
????????private?void?Application_Startup(object?sender?StartupEventArgs?e)
????????{
????????????InvokeMainThreadHelp.Instance.Init_Set_curentThead_To_MainThreadId();
????????????LogCaliHelper.GlobalLog.SaveEnable?=?true;
????????????LogCaliHelper.GlobalLog.Init_Try_Only_Once();
????????????ExeStartConfig.Instance.vs_debug?=?PathHelp.is_path_in_debug();
????????????var?Tier=System.Windows.Media.RenderCapability.Tier;
????????????
?????????
????????}
????????private?void?Application_Exit(object?sender?ExitEventArgs?e)
????????{
????????????try
????????????{
????????????????foreach(var?item?in?ConnectDataHold.Instance.ConnectItemList)
????????????????{
????????????????????try
????????????????????{
????????????????????????if?(item.SerialCurrent?!=?null)
????????????????????????{
????????????????????????????item.SerialCurrent.Close();
????????????????????????}
????????????????????}
????????????????????catch(Exception?ex)
????????????????????{
????????????????????}
????????????????}
????????????}catch(Exception?ex)
????????????{
????????????}
????????}
????}
}
- 上一篇:C#初學者編程150個
- 下一篇:最新C#9.0官方中文教程(共1866頁)
評論
共有 條評論