private void Form1_Load(object sender, EventArgs e) { Config.Load(AppDomain.CurrentDomain.BaseDirectory + "Config.ini"); this._udpServer = new UDPListener(int.Parse(Config.Items["UdpPort"])); if (Config.Items["IsComEnable"] == "1") { this._comServer = new COMListener(Config.Items["ComPort"], Config.Items["ComNewLine"]); } this._tcpServer = new TcpScriptListener(int.Parse(Config.Items["TcpPort"])); this.InitLogger(); this.StartServers(); }
private void MainForm_Load(object sender, EventArgs e) { Config.Load(AppDomain.CurrentDomain.BaseDirectory + "Config.ini");//加载配置文件 _udpServer = new UDPListener(int.Parse(Config.Items["UdpPort"])); #region COMListener //if (Utility.ConfigData.GetInstance().GetIsComEnable() == "1") //{ // _comServer = new COMListener(Config.Items["ComPort"], Config.Items["ComNewLine"]); //} #endregion _tcpServer = new TcpScriptListener(int.Parse(Config.Items["TcpPort"])); InitLogger(); CheckIsAutoRun(); StartServers(); }