private SynchronizationContext mainThreadSynContext; //主线程
mainThreadSynContext = new WindowsFormsSynchronizationContext();//当前主线程没有UI
mainThreadSynContext = SynchronizationContext.Current;//当前的主线程有UI
mainThreadSynContext.Post(new SendOrPostCallback(MyFunc), null);//抛到主线程之中