private void settingToolStripMenuItem_Click(object sender, EventArgs e) { frm_Setting frmSetting = new frm_Setting(); frmSetting.ShowDialog(); frmSetting.Dispose(); }
//load ip and port to connect private void loadCfg() { try { XmlDocument config = new XmlDocument(); string path = Application.StartupPath + @"\config.xml"; config.Load(path); _svrIP = IPAddress.Parse(config.SelectSingleNode("//ip").InnerText); _svrPort = Int32.Parse(config.SelectSingleNode("//port").InnerText); } catch { frm_Setting frmSetting = new frm_Setting(); frmSetting.ShowDialog(); frmSetting.Dispose(); } }