private void btn_save_Click(object sender, EventArgs e) { INIHelper ini = new INIHelper(Common.settingFilePath, "配置信息请勿修改"); try { string kjqd = string.Empty; if (this.cbox_kjqd.CheckState == CheckState.Checked) { kjqd = "是"; } else { kjqd = "否"; } string zdgx = string.Empty; if (this.cbox_zdzx.CheckState == CheckState.Checked) { zdgx = "是"; } else { zdgx = "否"; } string setting_zdgx = ini.ReadString("服务配置", "自动更新", ""); if (!setting_zdgx.Contains(zdgx)) { if (zdgx == "是") { isAutoRunWatch = "yes"; } else { isAutoRunWatch = "no"; } } string jg = string.Empty; if (this.cbox_jg.SelectedIndex == 0) { jg = "高"; } else if (this.cbox_jg.SelectedIndex == 1) { jg = "中"; } else if (this.cbox_jg.SelectedIndex == 2) { jg = "低"; } ini.WriteString("服务配置", "开机启动", kjqd); ini.WriteString("服务配置", "自动更新", zdgx); ini.WriteString("服务配置", "更新间隔", jg); MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK); this.DialogResult = DialogResult.OK; } catch (Exception ex) { throw ex; } }
private void btn_save_Click(object sender, EventArgs e) { INIHelper ini = new INIHelper(Common.settingFilePath, "配置信息请勿修改"); try { //基本信息 if (isDBFCheck) { ini.WriteString("SetStatus", "DBFPath", this.tbx_file.Text); ini.WriteString("基本配置", "扫描文件目录", this.tbx_file.Text); } if (isOracleCheck) { ini.WriteString("SetStatus", "OraclePath", str); ini.WriteString("基本配置", "数据库IP", this.tbx_ip.Text); ini.WriteString("基本配置", "数据库端口", this.tbx_port.Text); ini.WriteString("基本配置", "数据库", this.tbx_dbs.Text); ini.WriteString("基本配置", "表名", this.tbx_table.Text); ini.WriteString("基本配置", "用户名", this.tbx_uid.Text); ini.WriteString("基本配置", "密码", this.tbx_pwd.Text); } if (isDBFCheck || isOracleCheck) { this.settingInfoSaveEvent(); MessageBox.Show("系统参数保存成功,请重新在服务里打开【自动执行】!", "提示", MessageBoxButtons.OK); this.DialogResult = DialogResult.OK; } else { MessageBox.Show("没有数据保存!"); } } catch (Exception ex) { throw ex; } }