随笔分类 - C#
摘要:在编译的时候Embed Interop Types 请选择True
阅读全文
摘要:var thread = new Thread(ThreadDo);//ThreadDo是调用COM组件的方法 thread.SetApartmentState(ApartmentState.STA); thread.IsBackgound=True; thread.Start();
阅读全文
摘要:private void Do() { Task[] tasks = new Task[1]; Task task = new Task((param) => { }); tasks[0] = task; task.Start(); Task.WaitAll(tasks);//阻塞主线程 Task.
阅读全文
摘要:线程方法定义: public void ThreadDo(string param) 线程方法定义: public void ThreadDo(string param) { { } 线程方法调用: Thread thread = new Thread(() => ThreadDo("param1"
阅读全文

浙公网安备 33010602011771号