【带有参数的线程】
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()
{
//执行操作
}
多线程操作一览
最新推荐文章于 2021-02-28 15:35:55 发布