我想在程序启动的时候用WinFrom作为参数配置的界面,配置完成后程序正式启动并且新建一个专门的线程,在这个新线程内想用控制台作为输出!   如何使用!!!!

解决方案 »

  1.   

    启动时同时有一个控制台和一个winform窗体不知道能否满足你的要求,窗体关掉后控制台一样可以继续运行。
    Program.csusing System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;namespace WindowsFormsApplication2
    {
        static class Program
        {
            /// <summary>
            /// 应用程序的主入口点。
            /// </summary>
            //[STAThread]
            static void Main()
            {
                Form1 fm = new Form1(); 
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(fm);
                Console.ReadLine();
            }
        }
    }Fomr1using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;namespace WindowsFormsApplication2
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }        private void Form1_Load(object sender, EventArgs e)
            {
                Console.WriteLine("OK");
            }        private void button1_Click(object sender, EventArgs e)
            {
                Console.WriteLine("A Button");
            }
        }
    }
      

  2.   

    Program.cs有个地方写错了。        static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Form1 fm = new Form1(); 
                Application.Run(fm);
                Console.ReadLine();
            }
      

  3.   

    private void Form1_Load(object sender, EventArgs e)
            {
                Console.WriteLine("你要输出的内容╮(╯_╰)╭");
            }
      

  4.   

    和上边的一样!而且你可以跟一下你的程序,Console.ReadLine();根本就执行不到!!!不可能执行到呀!!!
      

  5.   

    咋啦?妹妹。winform程序可以选择输出类型为控制台,这很正常,控制台和窗体都会出现的。