private void button1_Click(object sender, EventArgs e) { userInput = pwdTxt.Text; if (!IsStart) { this.Hide(); return; } ConfigFileManager passWdFile = new ConfigFileManager(); if (File.Exists(Constant.ConfigPassWdFilePath)) { passWdFile.LoadFile(Constant.ConfigPassWdFilePath); } else { return; } string pwdTime = "0"; pwdTime = DateTime.Now.ToString("yyyyMMdd"); if (userInput.Equals(Pwd)) { //修改下次时间 DateTime nowAdd = DateTime.Now; nowAdd = nowAdd.AddMonths(PwdCount); pwdTime = nowAdd.ToString("yyyyMMdd"); passWdFile.WriteConfig(Constant.passwdTime, pwdTime); //修改密码输入的次数 int pwdInt = 0; if (int.TryParse(pwdTime, out pwdInt)) { PwdCount++; passWdFile.WriteConfig(Constant.passwdCount, PwdCount.ToString()); } this.Close(); } else { MessageBox.Show(Constant.pwdWrong); passWdFile.WriteConfig(Constant.passwdTime, pwdTime); Environment.Exit(0); this.Close(); } passWdFile.Dispose(); pwdTxt.Text = ""; }
void setParam(Dictionary <string, string> strLst) { foreach (string key in strLst.Keys) { config.WriteConfig(ParamStr, configStr, key, strLst[key]); } tkxs = strLst[sysInfo.param[0]]; videoPath = strLst[sysInfo.param[1]]; imgPath = strLst[sysInfo.param[2]]; imgType = strLst[sysInfo.param[3]]; }
public void setData(string[] s) { if (s.Length != 25) { return; } PrjName = s[0]; PrjOperator = s[1]; PrjDevice = s[2]; PrjCompany = s[3]; PrjDirection = s[4]; PrjAddress = s[5]; InsQdJingHao = s[6]; InsZdJingHao = s[7]; InsJingKouGaoCheng = s[8]; InsJingKouJingdu = s[9]; InsJingKouJWeidu = s[10]; InsGuanDuanTypeID = s[11]; InsGuanDuanMaterialID = s[12]; InsGuanDuanDiameter = s[13]; InsGuanDuanLength = s[14]; InsGuanDuanZgLength = s[15]; PipeBelongCompany = s[16]; DesignSlope = s[17]; DesignDepth = s[18]; BuildDateTime = s[19]; EvalType = s[20]; AreaImportance = s[21]; Soil = s[22]; PayLoad = s[23]; StrExplain = s[24]; string strLst = ""; for (int i = 0; i < s.Length; i++) { if (i != s.Length - 1) { strLst = strLst + s[i] + prjCfg.splitChar; } else { strLst = strLst + s[i]; } } if (strLst.Length > 0) { cfg.WriteConfig(prjCfg.demoStr, prjCfg.ListStr, strLst); //MessageBox.Show("参数已保存!"); } }
public static bool setLangId(int id, ConfigFileManager p) { ConfigFileManager langXml = p;// ConfigFileManager(Constant.ConfigParamFilePath); try { langXml.WriteConfig(langStr, id.ToString()); } catch (Exception ex) { return(false); } return(true); }
public void ChangePrintMode(int value) { if (PrinterSettings.InstalledPrinters.Count == 0) { value = 0; LogManager.WriteProgramLog(Constant.DeviceNoPrinter); } paramFile.WriteConfig(Constant.printBarcodeMode, value.ToString()); printBarCodeMode = value; if (printBarCodeMode == Constant.AutoBarCode) { evokDevice.SetMValueON(plcHandlebarCodeOutInPs); } else { evokDevice.SetMValueOFF(plcHandlebarCodeOutInPs); } }