I am currently working on developing a web application that has the ability to read specific log files provided by users and then utilize Microsoft's LogParser 2.2 exe to parse these logs and generate the requested output.
My approach involves running the local LogParser.exe on the user's system and using the resulting output for further processing.
Despite my efforts, I seem to have encountered an issue with my code where the expected output or error is not being generated.
The relevant segment of my code looks like this:
protected void Button2_Click(object sender, EventArgs e)
{
try
{
string fileName = @"C:\Program Files (x86)\Log Parser 2.2\LOGPARSER.exe";
string filename = "LogParser";
string input = " -i:IISW3C ";
string query = " Select top 10 cs-ur-stem, count(cs-ur-stem) from " + TextBox1.Text + " group by cs-uri-stem order by count(cs-ur-stem)";
string output = " -o:DATAGRID ";
string argument = filename + input + query + output;
ProcessStartInfo PSI = new ProcessStartInfo(fileName)
{
UseShellExecute = false,
Arguments = argument,
RedirectStandardInput = true,
RedirectStandardOutput = true,
CreateNoWindow = false
};
Process LogParser = Process.Start(PSI);
LogParser.Start();
}
catch (Exception Prc)
{
MessageBox.Show(Prc.Message);
}
I suspect there may be an issue in my implementation. Can anyone provide guidance on how to rectify this? Should I consider using a JavaScript ActiveX control as an alternative solution?
Any assistance would be greatly appreciated.
((This web application is designed for internal use within my organization, assuming that the log parser tool will already be installed on the user's computer.)
Thank you,
Ravi