Fix attach console

This commit is contained in:
ChsBuffer
2020-12-16 16:27:40 +08:00
parent 2afc5ff21a
commit 77680e2c02

View File

@@ -20,8 +20,10 @@ namespace Netch
{
if (args.Contains("-console"))
{
NativeMethods.AllocConsole();
NativeMethods.AttachConsole(-1);
if (!NativeMethods.AttachConsole(-1))
{
NativeMethods.AllocConsole();
}
}
// 创建互斥体防止多次运行