多线程操作一览

【带有参数的线程】
        private void GetLoadFuncation()
        {
            Thread thread = new Thread(new ParameterizedThreadStart(GetAllFuncation));
            thread.Name = "泓辰信息";
            thread.Start("上海泓辰信息科技有限公司");
        }

        private void GetAllFuncation(object msg)
        {
            MessageBox.Show(msg.ToString());
        }



【无参数的线程】
            System.Threading.Thread thread = new System.Threading.Thread(Start);
            thread.Start();


           private static void Start()
         {
           MessageBox.Show("ddd");
        }



【WPF线程操作控件】
            System.Threading.Thread thread = new System.Threading.Thread(Start);
            thread.Start();


             private static void Start()
        {
            System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Background, new DoTask(GetFillTreeView));
        }

        private static void GetFillTreeView()
        {
	//执行操作            
        }

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值