添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
 [DllImport("kernel32.dll")]
        public static extern Boolean AllocConsole();//显示控制台
        [DllImport("kernel32.dll")]
        public static extern Boolean FreeConsole(); //释放控制台、关闭控制台
public Form1()
            InitializeComponent(); 
            AllocConsole();
            Console.WriteLine("111");
        private void button1_Click(object sender, EventArgs e)
            Thread thread = new Thread(() =>
                int i=0;
                while (i < 100)
                    Console.WriteLine(DateTime.Now.ToString());
                    Thread.Sleep(1000);
                    i++;
            thread.Start();