在代码段中添加:
Thread t = new Thread((ThreadStart)(() => { //需要处理的逻辑 } )); t.SetApartmentState(ApartmentState.STA); t.Start(); t.Join();