Good morning,
I am trying to extract the list of files that contains a .rar file, I have searched for several solutions and I can not find how to do it from c #, the only option that was found was by means of a console using the following code.
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "cmd";
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.RedirectStandardOutput = true;
//proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();
proc.StandardInput.WriteLine(@"rar l E:\test.rar >> E:\test.csv");
proc.StandardInput.Flush();
//proc.StandardInput.Close();
proc.Close();
}
The line "rar l E: \ test.rar> > E: \ test.csv" works correctly in the console, before using it, copy the rar.exe file that is generated when installing winrar on my machine, in the System32 folder.
The code generates the following error when executing it from C #.
I need help please.