Exemple #1
0
 private void DisposeLastFileExporter()
 {
     if (null != this.fileExporter)
     {
         this.fileExporter.Dispose();
         this.fileExporter = null;
     }
     BattleDBHelper.SaveCacheData();
 }
Exemple #2
0
        protected override void LoadFile()
        {
            try
            {
                if ((null == this.HttperParamsItem) || (string.IsNullOrEmpty(this.HttperParamsItem.DataFilePath)))
                {
                    return;
                }

                this.accountList.Clear();
                this.TotalCount = 0;
                using (StreamReader sr = new StreamReader(this.HttperParamsItem.DataFilePath))
                {
                    while (!sr.EndOfStream && !isDisposed)
                    {
                        PwdResetItem item = TextToItemHelper.GetPwdResetItem(sr.ReadLine(),
                                                                             this.HttperParamsItem.DataFormat, WowLogManager.Instance);
                        if (null != item)
                        {
                            item.Index = ++this.TotalCount;
                            this.accountList.Add(item);
                        }

                        if (this.TotalCount % 10 == 0)
                        {
                            this.SetAutoResetEvent(false);
                            Application.DoEvents();
                        }
                    }
                }
            }
            finally
            {
                if (accountList.Count == 0)
                {
                    LogManager.InfoWithCallback("-> 请检查数据文件的格式是否正确,当前格式无法解析EMAIL、姓名!!!!");
                    this.IsFinished = true;
                }
                BattleDBHelper.SaveCacheData();
                LogManager.InfoWithCallback("-> 完成数据从文件提取,正在开始网络查询!");
                this.SetAutoResetEvent(true);
            }
        }