private void RTU_Control_ToolStripMenuItem_Click(object sender, EventArgs e) { // AppRtu2.AppRtu.aaa(); Thread rtuThread = null; RtuInterface rtu = null; rtu = new Rtu(); rtuThread = new Thread(new ThreadStart(rtu.threadRun)); AppRtu2.AppRtu dlg = new AppRtu2.AppRtu(rtu, rtuThread); dlg.ShowDialog(); }
public ConstructFactory() { try { Assembly assemObj = Assembly.GetExecutingAssembly(); Version v = assemObj.GetName().Version; // 현재 실행되는 어셈블리..dll의 버전 가져오기 int majorV = v.Major; // 주버전 int minorV = v.Minor; // 부버전 int buildV = v.Build; // 빌드번호 int revisionV = v.Revision; // 수정번호 string FullV = majorV.ToString() + "."; FullV = FullV + minorV.ToString() + "."; FullV = FullV + buildV.ToString() + "."; FullV = FullV + revisionV.ToString(); if (rtutype == "idon") { idonrtu = new Idon_Rtu("./config/rtuPropertys.xml"); } else if (rtutype == "cmm3") { rtu = new Rtu("./config/rtuPropertys.xml"); } else if (rtutype == "cmm1") { cmm1rtu = new Cmm1_Rtu("./config/rtuPropertys.xml"); } else { idonrtu = new Idon_Rtu("./config/rtuPropertys.xml"); } } catch (Exception e) { Log.WriteLog(LogLevel.FATAL, "", e.ToString()); } finally { } }
static void Main() { #region log4net XmlConfigurator.Configure(new System.IO.FileInfo(".\\config/rtuLog.xml")); #endregion //log4net log.Fatal("AppRtu Program Start"); IntPtr hWnd = FindWindow(null, "AppRtu"); if (hWnd.ToInt32() > 0) { //존재 할 경구 중복 일 경우 log.Fatal("AppRtu Program 이미 실행 중입니다."); Application.Exit(); return; } Thread rtuThread = null; RtuInterface rtu = null; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { rtu = new Rtu(); rtuThread = new Thread(new ThreadStart(rtu.threadRun)); //rtuThread.Start(); Application.Run(new AppRtu(rtu, rtuThread)); } catch (System.Exception ex) { log.Fatal(ex.ToString()); } }