public void FileUpload_Synchronous(string Method, string parameters, string username, string pwd, string domain, byte[] data, Action <Dictionary <string, object> > callBack) { try { try { string result = Client.Fontion_Uplode(parameters, username, pwd, domain, data); Dictionary <string, object> dicResult = JsonManage.JsonToDictionary(result); callBack(dicResult); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 方法执行(唯一入口点) /// </summary> /// <param name="username">用户名称</param> /// <param name="pwd">用户密码</param> /// <param name="domain">域名</param> public void Function_Invoke(string Method, string parameters, string username, string pwd, string domain, Action <Dictionary <string, object> > callBack) { try { new Thread(() => { string result = Client.Fontion(parameters, username, pwd, domain); Dictionary <string, object> dicResult = JsonManage.JsonToDictionary(result); callBack(dicResult); }) { IsBackground = true }.Start(); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 文件上传 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Client_Fontion_UplodeCompleted(object sender, Fontion_UplodeCompletedEventArgs e) { try { if (e.Error == null) { Dictionary <string, object> result = JsonManage.JsonToDictionary(e.Result); string methodName = Convert.ToString(result[MethodName]); if (result.ContainsKey(MethodName)) { dicReturns(result); } } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }