回调的类
[CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant, UseSynchronizationContext = false)] public class backcall : LiuLanCallback { static string ss; //所有控件的父类,用于控制控件 private static Control ctrl = null; delegate void wei();//委托 public backcall(){} //初始化,在ui线程里,将控件传过来 public backcall(Control rb) { ctrl = rb; } //设置对ui的更改 public void message1() { ctrl.Text = "141474144"; Thread.Sleep(1000); } //回调的的方法,调用 委托 public void ToGetMessage() { if (ctrl.InvokeRequired) { wei w = new wei(message1); ctrl.BeginInvoke(w); //异步调用 同步用invoke } } }