Example #1
0
        public void StartFileChecker()
        {
            var pin = "";

            try
            {
                //check for files
                var filename = CheckforFiles();
                if (!string.IsNullOrEmpty(filename))
                {
                    //get the pin
                    pin = _textFile.GetPinFromUserId(0, filename);
                    //save file to database
                    if (_textFile.AddPasswordListToDb() == 0)
                    {
                        throw new Exception("Make sure that your email address "
                                            + "is on the first line by itself and your UserId has "
                                            + "a value of 0.");
                    }

                    //place passwords in output file
                    _textFile.PlacePasswordRecordsInFile(pin, ShiftDirection.ShiftNone);
                    //email the user
                    EmailUser(pin, @"File Successfully Added.");
                }
            }
            catch (Exception ex)
            {
                EmailUser(pin, ex.Message);
            }
        }