/// <summary> /// 创建默认的配置文件 /// </summary> internal static void BuildDefaultConfigFile() { string strConfigPath = Path.Combine(Application.StartupPath, ServerConfig.ConfigName); if (!File.Exists(strConfigPath)) { IniClass ini = new SmartClient.IniClass(strConfigPath); ini.WriteValue("Link", "server", "localhost"); ini.WriteValue("Link", "port", "2017"); } }
private void btnSave_Click(object sender, EventArgs e) { try { string strConfigName = "WebLink.ini"; string strConfigPath = Path.Combine(Application.StartupPath, strConfigName); IniClass ini = new SmartClient.IniClass(strConfigPath); ini.WriteValue("Link", "server", this.txtAddress.Text); ini.WriteValue("Link", "port", this.txtPort.Text); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }