我有 2 个在 .NET 中创建的程序 (.exe)。我们称他们为 Master 和 Worker。Master 启动 1 个或多个 Worker。Worker不会与用户交互,但它是一个 WinForms 应用程序,它接收命令并根据从 Master 接收到的命令运行 WinForms 组件。
我希望 Worker 应用程序完全隐藏运行(当然除了显示在任务管理器中)。我认为我可以使用StartInfo.CreateNoWindow和StartInfo.WindowStyle属性来完成此操作,但我仍然在表单中看到 Client.exe 窗口和组件。但是,它不会显示在任务栏中。
Process process = new Process
{
EnableRaisingEvents = true,
StartInfo =
{
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden,
FileName = "Client.exe",
UseShellExecute = false,
ErrorDialog = false,
}
};
我需要怎么做才能让 Client.exe 运行,但不显示?ㅤㅤㅤㅤㅤ</p>