use console output in winforms
Published: 15. December 2008 | Updated: 20. December 2008License: Microsoft Public License (MS-PL)
Categories: Windows » Win32, Winforms
Tags: C# Console Win32 Windows Winforms
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 » |





