using System.Runtime.InteropServices;
[DllImport("kernel32.dll")]
public static extern bool AllocConsole();
[DllImport("kernel32.dll")]
public static extern bool FreeConsole();
本文介绍了使用 C# 进行控制台操作的方法,通过调用 kernel32.dll 中的 AllocConsole 和 FreeConsole 函数来实现控制台的分配与释放。
using System.Runtime.InteropServices;
[DllImport("kernel32.dll")]
public static extern bool AllocConsole();
[DllImport("kernel32.dll")]
public static extern bool FreeConsole();

被折叠的 条评论
为什么被折叠?
