<分区>
在下面的 C# 代码中,我遇到了错误,
ProcessStartInfo psi = new ProcessStartInfo("logman.exe")
{
RedirectStandardOutput = true,
Arguments = "FabricTraces | findstr Root",
WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false
};
Process proc = Process.Start(psi); ;
StreamReader myOutput = proc.StandardOutput;
proc.WaitForExit(20000);
if (proc.HasExited)
{
Console.WriteLine( myOutput.ReadToEnd());
}
错误,
Argument '|' is unknown.
Argument 'findstr' is unknown.
Argument 'Root' is unknown.
我需要传递以下参数,该怎么做?感谢您的回答。
FabricTraces | findstr Root
控制台输出,
C:>logman.exe findstr根目录 根路径:C:\ProgramData\Windows Fabric\Fabric\log\Traces\
C:>