private void LoadConfig(string path) { filePath = path; IniFiles iniConfig = new IniFiles(path); GapSeconds = iniConfig.ReadInteger(loopSection, gapSecond, 4); LoopTimes = iniConfig.ReadInteger(loopSection, loopTimes, 3); MaxWaitConfirmTimes = iniConfig.ReadInteger(loopSection, confirmWaitTimes, 5); // 短信验证供应商 providorId = iniConfig.ReadInteger(phoneSection, provideID, 1); phoneAccount.UserName = iniConfig.ReadString(phoneSection, user, "hispy"); phoneAccount.Passwd = iniConfig.ReadString(phoneSection, passwd, "123456flag"); phoneAccount.ProjID = iniConfig.ReadString(phoneSection, proj, "17"); phoneRecheckCount = iniConfig.ReadInteger(loopSection, phoneReCheckCnt, 4); // 账号相关 pwdLenght = iniConfig.ReadInteger(accountInfoSection, pwdLenghtStr, 15); symbolsCnt = iniConfig.ReadInteger(accountInfoSection, symbolsCntStr, 3); enCount = iniConfig.ReadInteger(accountInfoSection, enCountStr, 10); numCount = iniConfig.ReadInteger(accountInfoSection, numCountStr, 5); baseLength = iniConfig.ReadInteger(accountInfoSection, enBaseLength, 5); }
protected virtual void Dispose(bool disposing) { if (disposing) { //执行基本的清理代码 IniFiles iniConfig = new IniFiles(filePath); iniConfig.WriteInteger(loopSection, loopTimes, LoopTimes); iniConfig.WriteInteger(loopSection, gapSecond, GapSeconds); iniConfig.WriteInteger(loopSection, confirmWaitTimes, MaxWaitConfirmTimes); iniConfig.WriteInteger(accountInfoSection, pwdLenghtStr, pwdLenght); iniConfig.WriteInteger(accountInfoSection, symbolsCntStr, symbolsCnt); iniConfig.WriteInteger(accountInfoSection, enCountStr, enCount); iniConfig.WriteInteger(accountInfoSection, numCountStr, numCount); iniConfig.WriteInteger(accountInfoSection, enBaseLength, baseLength); iniConfig.WriteInteger(phoneSection, provideID, providorId); iniConfig.WriteString(phoneSection, user, phoneAccount.UserName); iniConfig.WriteString(phoneSection, passwd, phoneAccount.Passwd); iniConfig.WriteString(phoneSection, proj, phoneAccount.ProjID); iniConfig.UpdateFile(); } }