private void revise_Click_1(object sender, EventArgs e) { string path = listSys5.Text; //用户设置的path try { if (Directory.Exists(path)) { //如果存在 List <string> list = new List <string>(); for (int i = 0; i < 6; i++) { TextBoxX C = (TextBoxX)this.Controls.Find("listSys" + (i + 1), true)[0]; list.Add(C.Text.Trim()); } if (SySetHeip.SysetInfo(list) > 0) { Common.Msg.Warning("修改成功"); SySetHeip.ConfigurationInfo(SySetHeip.GetSysConfig().Tables[0]); } else { Common.Msg.Warning("修改失败"); } } //不存在,用用户设置path创建路径 DirectoryInfo di = Directory.CreateDirectory(path); }//创建不成功 catch { Common.Msg.Warning("修改失败,请检查"); } }
private void btnSet_Click(object sender, EventArgs e) { string path = SetCSV.Text; //用户设置的path try { if (Directory.Exists(path)) { //如果存在 if (RefreshTime.Text != "" && SetCSV.Text != "") { int conn = SySetHeip.SysetInfo(RefreshTime.Text.Trim(), SetCSV.Text.Trim()); if (conn > 0) { Common.Msg.Warning("修改成功"); SySetHeip.ConfigurationInfo(SySetHeip.GetSysConfig().Tables[0]); } else { Common.Msg.Warning("修改失败"); } } else { Common.Msg.Warning("修改失败"); } } //不存在,用用户设置path创建路径 DirectoryInfo di = Directory.CreateDirectory(path); }//创建不成功 catch { Common.Msg.Warning("CSV保存路径不合法,请检查"); } }