C# Windows Forms(윈폼) 애플리케이션에서 콘솔 창을 함께 사용(AllocConsole)
using System; using System.Runtime.InteropServices; using System.Windows.Forms; namespace WindowsFormsAppWithConsole { static class Program { [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool AllocConsole(); [STAThread] static void Main() { AllocConsole(); // 콘솔 창 할당 ... } } }
2024.01.07