使用命令行参数在C#中运行exe,禁止显示dos窗口

Ego*_*gon 2 c# lame

我正在使用蹩脚的转码来完成我的一个项目.问题是,当我从C#调用lame时,会弹出一个DOS窗口.有什么方法可以压制这个吗?

到目前为止,这是我的代码:

Process converter =
    Process.Start(lameExePath, "-V2 \"" + waveFile + "\" \"" + mp3File + "\"");

converter.WaitForExit();
Run Code Online (Sandbox Code Playgroud)

tan*_*ius 8

你尝试过这样的事情:

using( var process = new Process() )
{
    process.StartInfo.FileName = "...";
    process.StartInfo.WorkingDirectory = "...";
    process.StartInfo.CreateNoWindow = true;
    process.StartInfo.UseShellExecute = false;
    process.Start();
}
Run Code Online (Sandbox Code Playgroud)