C#在winform中调用系统控制台输出

用win32 API函数实现:

[DllImport("kernel32.dll")]
static extern bool FreeConsole();
[DllImport("kernel32.dll")]
public static extern bool AllocConsole();

加入上面的代码后,我们直接就用 输出的代码就行了 Console.WriteLine(“试试”);

来自文章:https://www.cnblogs.com/seayxu/p/4643306.html

在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章