解决方案 »

  1.   

    http://download.csdn.net/detail/caozhy/4832657google 
    background worker C#
    async long time C#
      

  2.   

    个人感觉 独立线程还是比较适合你的。backgroundworker
      

  3.   


        public class Schedule
        {        private TextBox _Txtbox = null; //这里传进一个 窗体的 文本框        public TextBox Txtbox
            {
                get { return _Txtbox; }
                set { _Txtbox = value; }
            }        public bool IsDisplay = true;//是否输出操作  就像很多脚本一样,都有那个打勾就显示操作        public Schedule()
            { }        public Schedule(TextBox txtbox,bool isDisplay=true)
            {
                this.Txtbox = txtbox;
                this.IsDisplay = isDisplay;
            }
            public void WritLine(string s)
            {
                if (IsDisplay & Txtbox!=null)
                { 
                    Txtbox.AppendText(Environment.NewLine+s );       
                    //操作 传进来的 文本框         实现显示操作的具体过程 和进度
                }
            }        public void Writ(string s)
            {
                if (IsDisplay & Txtbox != null)
                {
                    Txtbox.AppendText(s);
                }            
            }    }
    小弟刚学,没有太多发贴 和回贴经验,下次会注意的,这是我的代码。这是我能想到的方法,只是不知道我这样写会不会太麻烦(不够简洁)
    所以特发贴问下有没有其他机制还是模式可以参考下。。