using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;using System.Windows.Forms;using System.Runtime.InteropServices; //1加命名空间namespace WindowsFormsApp1{static class Program{// 引用win32api[DllImport("kernel32.dll")] static extern bool FreeConsole();[DllImport("kernel32.dll")]public static extern bool AllocConsole();/// <summary>/// 应用程序的主入口点。/// </summary>/// [STAThread]static void Main(){AllocConsole();//调用系统API,调用控制台窗口Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Form1.Fun();Console.ReadLine();Application.Run(new Form1());FreeConsole();//释放控制台}}}
700字范文,内容丰富有趣,生活中的好帮手!