Wednesday, May 28, 2014

How to show console in winForms?

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();

No comments:

Post a Comment