private void initSetConfig() { string msg; Global.ConfigInfoList.Clear(); Global.ConfigInfoList.Add(Global.ConfigInfo.FtpPath, "39.108.188.162"); Global.ConfigInfoList.Add(Global.ConfigInfo.WebAddAddr, "www.baidu.com"); Global.ConfigInfoList.Add(Global.ConfigInfo.YeMeiMsg, "维修秘籍"); Global.ConfigInfoList.Add(Global.ConfigInfo.InitAddr, ""); int ret = ReturnData.DoSetConfigInfo(Global.ConfigInfoList, out msg); }
private void BtnYes_Click(object sender, EventArgs e) { try { string strFtpPath = tbFTPPath.Text; string strWebAddAddr = tbWebAddAddr.Text; string strYeMeiMsg = tbYeMei.Text; string strInitWebAddr = tbDefaultWebPath.Text; if (!string.IsNullOrEmpty(strFtpPath)) { Global.ConfigInfoList[Global.ConfigInfo.FtpPath] = strFtpPath; DialogResult = DialogResult.OK; } if (!string.IsNullOrEmpty(strWebAddAddr)) { Global.ConfigInfoList[Global.ConfigInfo.WebAddAddr] = strWebAddAddr; DialogResult = DialogResult.OK; } if (!string.IsNullOrEmpty(strYeMeiMsg)) { Global.ConfigInfoList[Global.ConfigInfo.YeMeiMsg] = strYeMeiMsg; DialogResult = DialogResult.OK; } if (!string.IsNullOrEmpty(strInitWebAddr)) { Global.ConfigInfoList[Global.ConfigInfo.InitAddr] = strInitWebAddr; DialogResult = DialogResult.OK; } else { throw new Exception("请正确输入"); } if (DialogResult == DialogResult.OK) { string resmsg; ReturnData.DoSetConfigInfo(Global.ConfigInfoList, out resmsg); } } catch (Exception ex) { Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex); MessageBox.Show(ex.Message); } }