Winform程序显示控制台输出
internal static class Program
{
[DllImport("kernel32.dll")]
static extern bool FreeConsole();
[DllImport("kernel32.dll")]
static extern bool AllocConsole();
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
FreeConsole();
AllocConsole();
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}