我正在尝试从我的 C# 控制台应用程序运行 VLC,但我不能。我知道还有其他类似的问题(例如Launching process in C# without Distracting Console Window和C# Run external console application and no ouptut?和C#: Run external console program as hidden)并从中我得出以下代码:
Process process = new Process();
process.StartInfo.FileName = "C:\\Users\\XXXXX\\Desktop\\VLC\\vlc.exe";
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
//process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.StartInfo.Arguments = " -I dummy";
process.Start();
但是,当我注释和取消注释 WindowStyle 行时,控制台仍然显示。怎么了?