Ejemplo n.º 1
0
        public static void ProcessFile(string inputFileName, string outputFileName)
        {
            try
            {
                if (File.Exists(outputFileName))
                {
                    File.Delete(outputFileName);
                }

                using (FileStream fs = File.Create(outputFileName))
                {
                    using (StreamWriter streamWriter = new StreamWriter(fs))
                    {
                        using (StreamReader streamReader = new StreamReader(inputFileName))
                        {
                            string line;
                            while ((line = streamReader.ReadLine()) != null)
                            {
                                line = $"{line},{IbanValidator.IsValidIban(line).ToString().ToLower()}";
                                streamWriter.WriteLine(line);
                            }
                        }
                    }
                }
            }
            catch (IOException ex)
            {
                Logger.WriteError($"Error: Can not create output file for {inputFileName}. Error message: {ex.Message}\n");
            }

            //Thread.Sleep(10000);
        }
Ejemplo n.º 2
0
 public void Process()
 {
     Logger.WriteLine($"{_iargs.IbanNumber} number is{(IbanValidator.IsValidIban(_iargs.IbanNumber) ? "" : " not")} a valid IBAN\n");
 }