public bool Load() { //载入脚本定时器信息 VerPacket pack = ConfigManager.Instance().GetVerPacket(); String text = pack.LoadFileToText(TextDefine.CONFIG_FILE_SCRIPTTIMER); CsvFile csv = new CsvFile(text); String v; for (int i = 0; i < csv.GetLine(); i++) { ScriptTimerInfo info = new ScriptTimerInfo(); info.name = csv.GetFieldInfoToValue(i, "name"); v = csv.GetFieldInfoToValue(i, "year"); info.year = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "month"); info.month = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "day"); info.day = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "hour"); info.hour = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "minute"); info.minute = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "second"); info.second = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "script_id"); info.script_id = Convert.ToUInt32(v); info.bTag = false; mListInfo.Add(info); } return(true); }
public bool Load() { //载入脚本定时器信息 VerPacket pack = ConfigManager.Instance().GetVerPacket(); String text = pack.LoadFileToText(TextDefine.CONFIG_FILE_SCRIPTTIMER); CsvFile csv = new CsvFile(text); String v; for (int i = 0; i < csv.GetLine(); i++) { ScriptTimerInfo info = new ScriptTimerInfo(); info.name = csv.GetFieldInfoToValue(i, "name"); v = csv.GetFieldInfoToValue(i, "year"); info.year = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "month"); info.month = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "day"); info.day = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "hour"); info.hour = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "minute"); info.minute = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "second"); info.second = Convert.ToInt32(v); v = csv.GetFieldInfoToValue(i, "script_id"); info.script_id = Convert.ToUInt32(v); info.bTag = false; mListInfo.Add(info); } return true; }