public void DisplaySetServerForm() { SetServer_Form frm = null; try { frm = new SetServer_Form(); if (frm.ShowDialog() == DialogResult.OK) { Logger.info("서버 IP 설정 변경"); } } catch (Exception ex) { Logger.error(ex.ToString()); } finally { if (frm != null) { frm.Dispose(); } } }
public void DisplaySetServerForm() { SetServer_Form frm = null; try { frm = new SetServer_Form(); if (frm.ShowDialog() == DialogResult.OK) { Logger.info("서버 IP 설정 변경"); } } catch (Exception ex) { Logger.error(ex.ToString()); } finally { if (frm != null) frm.Dispose(); } }
private void makeSetServerForm() { try { if (setserverform != null) { setserverform.Close(); setserverform = null; } setserverform = new SetServer_Form(); setserverform.btnSetting.MouseClick += new MouseEventHandler(btnSetting_MouseClick); serverIP = System.Configuration.ConfigurationSettings.AppSettings["serverip"]; string[] iparr = null; if (serverIP.Equals("localhost")) { setserverform.rbt_local.Checked = true; } else { setserverform.rbt_ip.Checked = true; iparr = serverIP.Split('.'); if (iparr.Length > 3) { setserverform.tbx_ip1.Text = iparr[0]; setserverform.tbx_ip2.Text = iparr[1]; setserverform.tbx_ip3.Text = iparr[2]; setserverform.tbx_ip4.Text = iparr[3]; } else { logWrite("serverIP 값이 올바르지 않음 : " + serverIP); } } setserverform.ShowDialog(); } catch (Exception ex) { logWrite(ex.ToString()); } }
private void btnSetting_MouseClick(object sender, MouseEventArgs e) { try { logWrite("Set server ip 실행!"); string tempip = ""; if (setserverform.rbt_ip.Checked == true) { tempip = setserverform.tbx_ip1.Text + "." + setserverform.tbx_ip2.Text + "." + setserverform.tbx_ip3.Text + "." + setserverform.tbx_ip4.Text; } else { tempip = "localhost"; } setConfigXml(AppConfigFullPath, "serverip", tempip); //-->setConfigXml(Application.StartupPath + "\\WDMsg_Client_Demo.exe.config", "serverip", tempip); setCRM_DB_HOST(XmlConfigFullPath, tempip); //-->setCRM_DB_HOST("c:\\MiniCTI\\config\\MiniCTI_config_demo.xml", tempip); setCRM_DB_HOST(XmlConfigOrgFullPath, tempip); //-->setCRM_DB_HOST(Application.StartupPath + "\\MiniCTI_config_demo.xml", tempip); serverIP = tempip; System.Configuration.ConfigurationSettings.AppSettings.Set("serverip", serverIP); setserverform.Close(); setserverform = null; } catch (Exception exception) { logWrite(exception.ToString()); } }