/// <summary> /// 获取Json 数据 /// </summary> /// <returns></returns> public string ToJson() { string json = string.Empty; try { ShowdialogModel showdialog; ShowdialogModelStore.Instance.TryGet(requestId, out showdialog); if (showdialog != null) { object data = showdialog.GetData(); AppInternals.Serialization.JSONSerialize.JSONParameters par = new AppInternals.Serialization.JSONSerialize.JSONParameters(); par.UseUTCDateTime = false; json = Arch.CFramework.AppInternals.Serialization.JSONSerialize.JSON.Instance.ToJSON(data, par); } } catch (Exception ex) { } return json; }
/// public static void Write(string module, string content) { if (string.IsNullOrWhiteSpace(content)) { throw new ArgumentNullException(content); } string appid = ConfigurationManager.AppSettings["appid"]; var info = new { Module = module, Content = content, ClientIP = Arch.CFramework.Utility.IPHelper.GetClientIP(), UserID = Authorization.Instance.CurrentUser() != null ? Authorization.Instance.CurrentUser().UserID : "白名单", AppID = appid }; Task.Factory.StartNew(() => { try { string url = CentralConfig.GetValue(AppConst.CFX_Center_ServiceUrl, DefaultCenter_serviceUrl).TrimEnd('/'); if (!string.IsNullOrWhiteSpace(url)) { AppInternals.Serialization.JSONSerialize.JSONParameters par = new AppInternals.Serialization.JSONSerialize.JSONParameters(); par.UseUTCDateTime = false; string json = Arch.CFramework.AppInternals.Serialization.JSONSerialize.JSON.Instance.ToJSON(info, par); HttpHelper.Post(url + "/api/LogWriter/Create", DataType.JSON, json); } } catch (Exception ex) { } }); }
public static void SendAppInfo(string domain, string virtualDirectory, string port) { new Action(() => { try { string url = CentralConfig.GetValue(AppConst.CFX_AppInfoCollectionService_Url); if (!string.IsNullOrWhiteSpace(url)) { AppInfo appInfo = GetCurrent(); appInfo.Domain = domain; appInfo.VirtualDirectory = virtualDirectory; appInfo.Port = port; AppInternals.Serialization.JSONSerialize.JSONParameters par = new AppInternals.Serialization.JSONSerialize.JSONParameters(); par.UseUTCDateTime = false; string json = Arch.CFramework.AppInternals.Serialization.JSONSerialize.JSON.Instance.ToJSON(appInfo, par); HttpHelper.Post(url, DataType.JSON, json); } } catch { } }).BeginInvoke(null, null); }