gpt4 book ai didi

c# - 为 ProcessStartInfo 传递参数时出错

转载 作者:太空宇宙 更新时间:2023-11-03 14:58:48 26 4
gpt4 key购买 nike

<分区>

在下面的 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:>

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com