I have a program which outputs various results after greping strings from a log text file. The results are shown onto a command line console.
Therefore are there anyways to generate the various output results into a html based report?
What methods could be used to convert the outputs? HtmlTextWriter? What are the steps needed to convert the file?
May someone please advise on the codes to do so? Thanks!
The codes:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using System.Web.UI; // The system is telling me that it does not exist in the namespace System.web....
foreach (String r in lines.Skip(1))
{
String[] token = r.Split(',');
String[] datetime = token[0].Split(' ');
String timeText = datetime[4];
Double rawSize = Convert.ToDouble(token[1]);
Double fileSize = ((rawSize / 1024) / 1024);
String actions = token[2];
String fileName = token[7];
if ((Path.GetExtension(token[7]).Contains(".exe") || (Path.GetExtension(token[7]).Contains(".msi"))))
{
Console.WriteLine("The time for this array is: " + timeText);
Console.WriteLine(token[7]);
Console.WriteLine(actions);
Console.WriteLine(fileSize);
ProgramFilter(actions, k, fileName);
x = 1;
Console.WriteLine("================================================");
}
}