Esempio n. 1
0
        protected override void ProcessLine(string line)
        {
            if (string.IsNullOrEmpty(line))
            {
                return;
            }
            AccountItem account = new AccountItem(line, DataFormat.MailPassword, "");

            if (account.IsValidate)
            {
                account.SplitChars = "  ";
                if (this.CurrentFilterParam.IsFilterChar)
                {
                    account.Password = this.RemoveChar(account.Password);
                }

                if (this.CurrentFilterParam.IsFilterNum)
                {
                    account.Password = this.RemoveNum(account.Password);
                }

                this.WriteLine(account.ToString());
            }
        }
Esempio n. 2
0
        protected virtual bool WriteToFile(AccountItem account)
        {
            StreamWriter sw = null;

            if (account.OldPassword.Length <= 3)
            {
                sw = swDic[3];
            }
            else if (account.OldPassword.Length >= 8)
            {
                sw = swDic[8];
            }
            else
            {
                sw = swDic[account.OldPassword.Length];
            }

            if (null == sw)
            {
                //LogManager.Error("File writer can't be null!");
                return(false);
            }
            if (null != sw)
            {
                sw.WriteLine(account.ToString());
                flushCount++;
                if (flushCount == 100)
                {
                    sw.Flush();
                    flushCount = 0;
                }
                return(true);
            }

            return(false);
        }