这应该工作。
using System.Runtime.InteropServices;private void Form1_Load(object sender, EventArgs e){ AllocConsole();}[Dllimport("kernel32.dll", SetLastError = true)][return: MarshalAs(UnmanagedType.Bool)]static extern bool AllocConsole();
这应该工作。
using System.Runtime.InteropServices;private void Form1_Load(object sender, EventArgs e){ AllocConsole();}[Dllimport("kernel32.dll", SetLastError = true)][return: MarshalAs(UnmanagedType.Bool)]static extern bool AllocConsole();