AsyncCallback aLoginCallback = delegate(IAsyncResult result) { var aSystemUser = WcfClient.Insta ...
AsyncCallback aLoginCallback = delegate(IAsyncResult result) { var aSystemUser = WcfClient.Instance.EndSystemUser_Login(result); result.AsyncWaitHandle.Close(); if (get='_blank'>string.IsNullOrWhiteSpace(aSystemUser.UserId)) { ShowMessageBoxInNonMainThread("登录失败:用户名称或者用户密码错误!"); return; } CommonCache.CurrentUser = aSystemUser; //SynchronizationContext和SendOrPostCallback的引入是为了解决不能在非主线程中访问主线程中创建的控件的问题 SendOrPostCallback aSendOrPostCallback = delegate { Hide(); MainForm.Instance.ShowDialog(); }; SynchronizationContext.Current.Send(aSendOrPostCallback, null); }; var aParam = GetForm<SystemUserParameter>(); WcfClient.Instance.BeginSystemUser_Login(aParam, aLoginCallback, null);
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:调用WCF的异步方法
关键词:异步
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。