private void btnVanReal_Click(object sender, EventArgs e) { try { if (this.gridView2.FocusedRowHandle < 0) { Basic.ShowMessage(1, "선택된 데이터가 없습니다."); return; } int i = this.gridView2.FocusedRowHandle; string vanType = this.gridView2.GetRowCellValue(i, "VAN_TYPE").ToString().Trim(); string ServerIP = this.gridView2.GetRowCellValue(i, "SERVER_IP").ToString().Trim(); string ServerPort = this.gridView2.GetRowCellValue(i, "SERVER_PORT").ToString().Trim(); SettingKeys.SetValue(SettingKeys.VAN_TYPE, vanType, true); SettingKeys.SetValue(SettingKeys.VAN_SVR_IP, ServerIP, true); SettingKeys.SetValue(SettingKeys.VAN_SVR_PORT, ServerPort, true); Basic.ShowMessage(1, "수정하였습니다."); lblVan.Text = vanType + " / " + ServerIP + " / " + ServerPort; lblWCF.Text = mService.ServiceURI; BizVan.SettingVanParm(vanType, ServerIP, ServerPort, " "); Basic.ShowMessage(1, "리얼 IP로 수정되었습니다. TID 를 갱신하기 위해 다시 실행하십시요"); Application.Exit(); } catch (Exception ex) { Basic.ShowMessage(3, ex.Message); } }
private void btnVanTest_Click(object sender, EventArgs e) { try { if (this.gridView2.FocusedRowHandle < 0) { Basic.ShowMessage(1, "선택된 데이터가 없습니다."); return; } int i = this.gridView2.FocusedRowHandle; string vanType = this.gridView2.GetRowCellValue(i, "VAN_TYPE").ToString().Trim(); string ServerIP = this.gridView2.GetRowCellValue(i, "TEST_IP").ToString().Trim(); string ServerPort = this.gridView2.GetRowCellValue(i, "TEST_PORT").ToString().Trim(); string TestTID = this.gridView2.GetRowCellValue(i, "TEST_TID").ToString().Trim(); SettingKeys.SetValue(SettingKeys.VAN_TYPE, vanType, true); SettingKeys.SetValue(SettingKeys.VAN_SVR_IP, ServerIP, true); SettingKeys.SetValue(SettingKeys.VAN_SVR_PORT, ServerPort, true); BizVan.SettingVanParm(vanType, ServerIP, ServerPort, TestTID); Basic.ShowMessage(1, "수정하였습니다."); lblVan.Text = vanType + " / " + ServerIP + " / " + ServerPort + " / TID = " + TestTID; lblWCF.Text = mService.ServiceURI; } catch (Exception ex) { Basic.ShowMessage(3, ex.Message); } }
static void Main(string[] args) { //DataTable dtBiz = new DataTable("CONFIG_DB_INFO"); //dtBiz.Columns.Add("SERVICE_NAME"); //dtBiz.Columns.Add("SERVICE_URI"); //dtBiz.Rows.Add("PFV [리조트통합]","http://116.123.223.4:51004/DataService.svc"); //dtBiz.Rows.Add("AMC [인사/회계]" ,"http://116.123.223.4:51006/DataService.svc"); //dtBiz.WriteXml(@"C:\CONFIG_INFO.xml"); string bb = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.ROOM_TASK_SKIP_YN).ToUpper(); string path = System.Windows.Forms.Application.StartupPath; if (File.Exists(path + "\\KiccDSC.ocx")) { System.Diagnostics.Process.Start("regsvr32.exe", "/s " + path + "\\KiccDSC.ocx").WaitForExit(); } if (File.Exists(path + "\\KSNet_Dongle.ocx")) { System.Diagnostics.Process.Start("regsvr32.exe", "/s " + path + "\\KSNet_Dongle.ocx").WaitForExit(); } if (File.Exists(path + "\\KisvanMS3.ocx")) { System.Diagnostics.Process.Start("regsvr32.exe", "/s " + path + "\\KisvanMS3.ocx").WaitForExit(); } if (args.Length > 0) { if (args[0].Trim() != "") { string[] arryInfo = args[0].Split('$'); if (arryInfo.Length > 0) { if (arryInfo[0] != "") //이이디나 비밀번호가 들어왔다 { string[] arryUserInfo = arryInfo[0].Split(','); if (arryUserInfo.Length == 2) { BizCommon.Parm.CurrentUserInformation.id = arryUserInfo[0]; BizCommon.Parm.CurrentUserInformation.Pwd = arryUserInfo[1]; } } if (arryInfo.Length > 1) { if (arryInfo[1] != "") { Parm.CONFIG_FILE = arryInfo[1]; } } } //string[] arryInfo = args[0].Split(','); //if (arryInfo.Length == 2) //{ // BizCommon.Parm.CurrentUserInformation.id = arryInfo[0]; // BizCommon.Parm.CurrentUserInformation.Pwd = arryInfo[1]; //} } } WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); bool hasAdministrativeRight = pricipal.IsInRole(WindowsBuiltInRole.Administrator); //스플레쉬 칼라값 및 레이블 칼라를 지정한다. /****************************************************** * 뮤택스를 쓰지 않는 이유 * 프로세스만 살아있다면 사용자는 프로세스를 강제로 * 종료 해야한다. (작업관리자에서) 그렇기 때문에 * 뮤택스를 사용하지 않고 Process를 강제로 Kill해준다. ***************************************************** / * * //프로세스 체크 * bool bProcessCheck = true; * Process currentPRocess = Process.GetCurrentProcess(); * Mutex dup = new Mutex(true, currentPRocess.ProcessName, out bProcessCheck); * * * if (!bProcessCheck) * { * MessageBox.Show("프로세스가 실행 중 입니다.","확인",MessageBoxButtons.OK,MessageBoxIcon.Asterisk); * Application.Exit(); * return; * } *********************************************************/ //프로세스 중복 확인 try { fnProcCheck(); /**/ //DataTable dtConnect = new DataTable("CONNECT_INFO"); ///************************************************************************************/ //dtConnect.Columns.Add("BIZ_CODE"); //dtConnect.Columns.Add("BIZ_NAME"); //dtConnect.Columns.Add("FILE_URI"); //dtConnect.Columns.Add("DB_URI"); //dtConnect.Rows.Add(new object[] {"10" ,"스코스" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"}); //dtConnect.Rows.Add(new object[] {"20" ,"천안리조트피에프브이(주)" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"}); //dtConnect.Rows.Add(new object[] {"21" ,"유러피안리조트" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"}); //dtConnect.Rows.Add(new object[] {"11" ,"부여리조트" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"}); //dtConnect.Rows.Add(new object[] {"R1" ,"부여리조트" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"}); //dtConnect.Rows.Add(new object[] {"22" ,"대천리조트" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/Download/" , "http://www.scosystem.co.kr:51004/WCF_SCOS_BIZ/DataService.svc"}); //dtConnect.WriteXml(@"C:\CONNECT_INFO.xml"); /************************************************************************************/ ///**/ //DataTable dtvan = new DataTable("VAN_INFO"); ///************************************************************************************/ //dtvan.Columns.Add("VAN_TYPE"); //dtvan.Columns.Add("VAN_NAME"); //dtvan.Columns.Add("SERVER_IP"); //dtvan.Columns.Add("SERVER_PORT"); //dtvan.Columns.Add("TEST_IP"); //dtvan.Columns.Add("TEST_PORT"); //dtvan.Rows.Add(new object[] {"KICC" ,"KICC 밴" , "203.233.72.55" , "15200" , "203.233.72.55" , "15200" }); //dtvan.WriteXml(@"C:\VAN_INFO.xml"); ///************************************************************************************/ if (System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_CONNECT_REFERENCE_FILE)) { Parm.mDataTable.dtConnectInfo.ReadXmlSchema(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_CONNECT_REFERENCE_FILE); Parm.mDataTable.dtConnectInfo.ReadXml(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_CONNECT_REFERENCE_FILE); } if (System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_VAN_REFERENCE_FILE)) { Parm.mDataTable.dtVanInfo.ReadXmlSchema(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_VAN_REFERENCE_FILE); Parm.mDataTable.dtVanInfo.ReadXml(System.Windows.Forms.Application.StartupPath + "\\" + Parm.mPath.PATH_VAN_REFERENCE_FILE); } SplashScreen.ShowSplashScreen(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.DoEvents(); for (int i = 0; i < 20; i++) { SplashScreen.SetStatus("시스템 로딩중..."); System.Threading.Thread.Sleep(50); } BizCommon.SettingKeys.Settings(); BizCommon.SettingKeys.Write(); if (!System.IO.File.Exists(BizCommon.SettingKeys.GetFilePath())) { SplashScreen.SetStatus("환경설정 파일이 없습니다...."); System.Threading.Thread.Sleep(1500); SplashScreen.SetStatus("환경설정 파일을 생성합니다."); System.Threading.Thread.Sleep(1000); SplashScreen.SetStatus("모든설정이 초기화 되었습니다."); System.Threading.Thread.Sleep(2000); SplashScreen.SetStatus("접속이 되지 않으면 Service 연결정보를 확인하세요"); System.Threading.Thread.Sleep(2000); } SplashScreen.SetStatus("접속정보를 확인 합니다."); System.Threading.Thread.Sleep(500); Application.DoEvents(); BizCommon.SettingKeys.Read(); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SplashScreen.SetStatus("시스템 환경변수를 구성합니다."); System.Threading.Thread.Sleep(1000); BizCommon.Parm.mMainStyle.WindowSkin = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.SKIN); BizCommon.Parm.mMainStyle.BAR_STYLE = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.BAR_STYLE); BizCommon.Parm.mMainStyle.BAR_STYLE1 = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.BAR_STYLE1); mService.ServiceURI = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.WEB_SERVICE_IP); mService.AuthId = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.AUTH_ID); mService.AuthPwd = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.AUTH_PWD); BizCommon.Parm.mMainStyle.IsRibonMini = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.RIBONMINI) == "TRUE" ? true : false; BizCommon.Parm.mMainStyle.MAIN_HEADER_LOCATION = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.MAIN_HEADER_LOCATION); BizCommon.Parm.mMainStyle.MAIN_HEADER_ORIENTAION = BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.MAIN_HEADER_ORIENTAION); /*Van 설정*/ BizVan.SettingVanParm(BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.VAN_TYPE), BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.VAN_SVR_IP), BizCommon.SettingKeys.GetString(BizCommon.SettingKeys.VAN_SVR_PORT), " "); /************************************************************************************************************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //SplashScreen.SetStatus("로컬컴퓨터 시간을 서버시간과 동기화 합니다..."); //Application.DoEvents(); //System.Threading.Thread.Sleep(50); //DataSet dsTime = DataLayer.ExecuteSpDataset("PKG_LOAD.PR_03", DataLayer.MessageEncoding.Default); //System.DateTime time = DateTime.Parse(dsTime.Tables[0].Rows[0][0].ToString().Trim()); //SplashScreen.SetStatus("시간을 설정합니다...."); //Application.DoEvents(); //Basic.SetSysDateTime(time); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string ver = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\Ver.txt"; Parm.VERSION = "정보없음"; if (File.Exists(ver)) { string[] lines = System.IO.File.ReadAllLines(ver, System.Text.Encoding.Default); if (lines.Length > 0) { Parm.VERSION = lines[0]; } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //오토업데이트 파일을 복사한다. string ConfigFilePathTmp = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\download"; if (Directory.Exists(ConfigFilePathTmp)) { string[] arry = Directory.GetFiles(ConfigFilePathTmp); for (int t = 0; t < arry.Length; t++) { string fileName = arry[t].Substring(arry[t].LastIndexOf('\\') + 1, arry[t].Length - arry[t].LastIndexOf('\\') - 1); if (fileName.ToUpper().IndexOf("SMARTUPDATE") >= 0 || (fileName.ToUpper().IndexOf("AUTOUPDATER") >= 0)) { string sourceFilePath = arry[t]; string destFilePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\" + fileName; if (System.IO.File.Exists(destFilePath)) { //파일이 있다면... DateTime timeDest = LastModFromDisk(destFilePath); DateTime timeSource = LastModFromDisk(sourceFilePath); if (timeSource > timeDest) { File.Copy(sourceFilePath, destFilePath, true); } } else { File.Copy(sourceFilePath, destFilePath, true); } //File.Delete(arry[t]); } } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Application.DoEvents(); SplashScreen.SetStatus("접속 URI : " + mService.ServiceURI); Application.DoEvents(); System.Threading.Thread.Sleep(2000); SplashScreen.CloseForm(); Application.Run(new Start()); } catch (Exception ex) { SplashScreen.SetStatus(ex.Message); Application.DoEvents(); System.Threading.Thread.Sleep(3000); Application.Exit(); } }