예제 #1
0
        private static void PrintProcessingResults(string outFile, string file, global::FileManager.FileContents fc)
        {
            string fileprefix = ConfigurationManager.AppSettings["FilePrefix"] ?? "";

            switch (cmdline.Value.Verbosity)
            {
            case OutputLevel.B:
                if (cmdline.Value.CSVOuput == false)
                {
                    File.AppendAllText(outFile, $"Number of possible patterns found: {scanner.PatternsFound.Count} in {file}\n");
                }
                else if (cmdline.Value.ImageScan == true)
                {
                    File.AppendAllText(outFile, $"{fileprefix}{file},{fc.Text?.Length},{scanner.PatternsFound.Count},{fc.HasImages}\n");
                }
                else
                {
                    File.AppendAllText(outFile, $"{fileprefix}{file},{fc.Text?.Length},{scanner.PatternsFound.Count}\n");
                }
                break;

            case OutputLevel.M:
                if (cmdline.Value.CSVOuput == false)
                {
                    File.AppendAllText(outFile, $"Found {scanner.PatternsFoundAsString} in {file}\n");
                }
                else if (cmdline.Value.ImageScan == true)
                {
                    File.AppendAllText(outFile, $"{fileprefix}{file},{fc.Text?.Length},{scanner.PatternsFoundAsString},{scanner.PatternsFound.Count},{fc.HasImages}\n");
                }
                else
                {
                    File.AppendAllText(outFile, $"{fileprefix}{file},{fc.Text?.Length},{scanner.PatternsFoundAsString},{scanner.PatternsFound.Count}\n");
                }
                break;

            case OutputLevel.V:
                if (cmdline.Value.CSVOuput == false)
                {
                    File.AppendAllText(outFile, $"Number of possible patterns found: {scanner.PatternsFound.Count}\n");
                }
                break;
            }
        }
예제 #2
0
 private static void PrintProcessingStart(string outFile, string file, global::FileManager.FileContents fc)
 {
     if (cmdline.Value.Verbosity == OutputLevel.V)
     {
         string fileprefix = ConfigurationManager.AppSettings["FilePrefix"] ?? "";
         if (cmdline.Value.CSVOuput == false)
         {
             File.AppendAllText(outFile, $"**********Processing file {file} ...**********\n");
         }
         else if (cmdline.Value.ImageScan == true)
         {
             File.AppendAllText(outFile, $"{fileprefix}{file},{fc.Text?.Length},{fc.HasImages},{scanner.PatternsFound.Count}\n");
         }
         else
         {
             File.AppendAllText(outFile, $"{fileprefix}{file},{fc.Text?.Length},{scanner.PatternsFound.Count}\n");
         }
     }
 }