How to

use console output in winforms

Published: 15. December 2008 | Updated: 20. December 2008
License: Microsoft Public License (MS-PL)
Categories: Windows » Win32, Winforms
Tags: C# Console Win32 Windows Winforms
Was this snippet helpful for you? YESYES / NONO
Get Analyzant!

Check your entire website from code to content in minutes with Analyzant, the free analysis suite.

Free download at analyzant.com

Import namespace

using System.Runtime.InteropServices;

Win32

[DllImport("kernel32.dll")]
static extern bool AttachConsole(int dwProcessId);

private const int ATTACH_PARENT_PROCESS = -1;

Code

AttachConsole(ATTACH_PARENT_PROCESS);

Console.WriteLine("console output");
Send us feedback about this snippet »



Related Snippets: