/// <summary> /// 创建服务 /// </summary> public BSStockService() { UserCookie cookie = new UserCookie(); UserCookieService cookieService = DataCenter.UserCookieService; if (cookieService.GetCookie("BSSTOCK", ref cookie) > 0) { try { m_bsStocks = JsonConvert.DeserializeObject<List<BSStockInfo>>(AESHelper.Decrypt(cookie.m_value)); } catch (Exception ex) { } if (m_bsStocks == null) { try { m_bsStocks = JsonConvert.DeserializeObject<List<BSStockInfo>>(cookie.m_value); } catch (Exception ex) { } } } }
/// <summary> /// 创建服务 /// </summary> public LevelService() { UserCookie cookie = new UserCookie(); UserCookieService cookieService = DataCenter.UserCookieService; if (cookieService.GetCookie("LEVEL", ref cookie) > 0) { try { m_levels = JsonConvert.DeserializeObject <List <LevelInfo> >(AESHelper.Decrypt(cookie.m_value)); } catch (Exception ex) { } if (m_levels == null) { try { m_levels = JsonConvert.DeserializeObject <List <LevelInfo> >(cookie.m_value); } catch (Exception ex) { } } } }
/// <summary> /// 创建服务 /// </summary> public FollowService() { UserCookie cookie = new UserCookie(); UserCookieService cookieService = DataCenter.UserCookieService; if (cookieService.GetCookie("FOLLOW", ref cookie) > 0) { try { m_follows = JsonConvert.DeserializeObject <List <FollowInfo> >(AESHelper.Decrypt(cookie.m_value)); } catch (Exception ex) { } if (m_follows == null) { try { m_follows = JsonConvert.DeserializeObject <List <FollowInfo> >(cookie.m_value); } catch (Exception ex) { } } } }
/// <summary> /// 创建服务 /// </summary> public DimensionService() { UserCookie cookie = new UserCookie(); UserCookieService cookieService = DataCenter.UserCookieService; if (cookieService.GetCookie("DIMENSION", ref cookie) > 0) { try { m_dimensions = JsonConvert.DeserializeObject <List <DimensionInfo> >(AESHelper.Decrypt(cookie.m_value)); } catch (Exception ex) { } if (m_dimensions == null) { try { m_dimensions = JsonConvert.DeserializeObject <List <DimensionInfo> >(cookie.m_value); } catch (Exception ex) { } } } }
/// <summary> /// 创建服务 /// </summary> public CalendarService() { UserCookie cookie = new UserCookie(); UserCookieService cookieService = DataCenter.UserCookieService; if (cookieService.GetCookie("CALENDAR", ref cookie) > 0) { try { m_calendars = JsonConvert.DeserializeObject <Dictionary <String, CalendarInfo> >(AESHelper.Decrypt(cookie.m_value)); } catch (Exception ex) { } if (m_calendars == null) { try { m_calendars = JsonConvert.DeserializeObject <Dictionary <String, CalendarInfo> >(cookie.m_value); } catch (Exception ex) { } } } }
/// <summary> /// 创建服务 /// </summary> public BusinessCardService() { UserCookie cookie = new UserCookie(); UserCookieService cookieService = DataCenter.UserCookieService; if (cookieService.GetCookie("BUSINESSCARD", ref cookie) > 0) { try { m_businessCards = JsonConvert.DeserializeObject <List <BusinessCardInfo> >(AESHelper.Decrypt(cookie.m_value)); } catch (Exception ex) { } if (m_businessCards == null) { try { m_businessCards = JsonConvert.DeserializeObject <List <BusinessCardInfo> >(cookie.m_value); } catch (Exception ex) { } } } }
/// <summary> /// 创建服务 /// </summary> public ProjectService() { UserCookie cookie = new UserCookie(); UserCookieService cookieService = DataCenter.UserCookieService; if (cookieService.GetCookie("PROJECT", ref cookie) > 0) { try { m_projects = JsonConvert.DeserializeObject <List <ProjectInfo> >(AESHelper.Decrypt(cookie.m_value)); } catch (Exception ex) { } if (m_projects == null) { try { m_projects = JsonConvert.DeserializeObject <List <ProjectInfo> >(cookie.m_value); } catch (Exception ex) { } } } }
/// <summary> /// 创建服务 /// </summary> public UserSecurityService() { UserCookie cookie = new UserCookie(); UserCookieService cookieService = DataCenter.UserCookieService; if (cookieService.GetCookie("USERSECURITY", ref cookie) > 0) { try { m_codes = JsonConvert.DeserializeObject <List <UserSecurity> >(cookie.m_value); } catch (Exception ex) { } if (m_codes == null) { try { m_codes = JsonConvert.DeserializeObject <List <UserSecurity> >(cookie.m_value); } catch (Exception ex) { } } } }
/// <summary> /// 保存信息 /// </summary> public void Save() { UserCookie cookie = new UserCookie(); cookie.m_key = "BSSTOCK"; cookie.m_value = AESHelper.Encrypt(JsonConvert.SerializeObject(m_bsStocks)); UserCookieService cookieService = DataCenter.UserCookieService; cookieService.AddCookie(cookie); }
/// <summary> /// 保存信息 /// </summary> public void Save() { UserCookie cookie = new UserCookie(); cookie.m_key = "CALENDAR"; cookie.m_value = AESHelper.Encrypt(JsonConvert.SerializeObject(m_calendars)); UserCookieService cookieService = DataCenter.UserCookieService; cookieService.AddCookie(cookie); }
/// <summary> /// 保存信息 /// </summary> public void Save() { UserCookie cookie = new UserCookie(); cookie.m_key = "BUSINESSCARD"; cookie.m_value = AESHelper.Encrypt(JsonConvert.SerializeObject(m_businessCards)); UserCookieService cookieService = DataCenter.UserCookieService; cookieService.AddCookie(cookie); }
/// <summary> /// 设置COOKIE /// </summary> /// <param name="var">变量</param> /// <returns>结果</returns> private double SETCOOKIE(CVariable var) { String cookieName = m_indicator.GetText(var.m_parameters[0]); UserCookieService cookieService = DataCenter.UserCookieService; UserCookie cookie = new UserCookie(); cookie.m_key = cookieName; cookie.m_value = m_indicator.GetText(var.m_parameters[1]); return(cookieService.AddCookie(cookie)); }
/// <summary> /// 保存信息 /// </summary> public void Save() { UserCookie cookie = new UserCookie(); cookie.m_key = "DIMENSION"; cookie.m_value = AESHelper.Encrypt(JsonConvert.SerializeObject(m_dimensions)); UserCookieService cookieService = DataCenter.UserCookieService; cookieService.AddCookie(cookie); }
/// <summary> /// 保存信息 /// </summary> public void Save() { UserCookie cookie = new UserCookie(); cookie.m_key = "PERSONAL"; cookie.m_value = AESHelper.Encrypt(JsonConvert.SerializeObject(m_personals)); UserCookieService cookieService = DataCenter.UserCookieService; cookieService.AddCookie(cookie); }
/// <summary> /// 保存信息 /// </summary> public void Save() { UserCookie cookie = new UserCookie(); cookie.m_key = "USERSECURITY"; cookie.m_value = JsonConvert.SerializeObject(m_codes); UserCookieService cookieService = DataCenter.UserCookieService; cookieService.AddCookie(cookie); }
/// <summary> /// 开启服务 /// </summary> /// <param name="appPath">程序路径</param> public static void StartService() { //读取配置 XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(DataCenter.GetAppPath() + "\\hostinfo.xml"); XmlNode root = xmlDoc.DocumentElement; foreach (XmlNode node in root.ChildNodes) { String name = node.Name.ToLower(); String value = node.InnerText; if (name == "clearcache") { m_hostInfo.m_clearCache = value == "1"; } else if (name == "defaulthost") { if (value.Length > 0) { String[] strs = value.Split(new String[] { ":" }, StringSplitOptions.RemoveEmptyEntries); m_hostInfo.m_defaultHost = strs[0]; m_hostInfo.m_defaultPort = CStr.ConvertStrToInt(strs[1]); } } else if (name == "isfull") { m_hostInfo.m_isFull = value == "1"; } else if (name == "localhost") { if (value.Length > 0) { String[] strs = value.Split(new String[] { ":" }, StringSplitOptions.RemoveEmptyEntries); m_hostInfo.m_localHost = strs[0]; m_hostInfo.m_localPort = CStr.ConvertStrToInt(strs[1]); } } } if (m_hostInfo.m_clearCache) { CFileA.RemoveFile(DataCenter.GetAppPath() + "\\usercookies.db"); } m_userCookieService = new UserCookieService(); Random rd = new Random(); m_isFull = m_hostInfo.m_isFull; String[] servers = new String[] { }; OwLibSV.BaseService.AddService(m_serverChatService); if (m_isFull) { OwLibSV.BaseService.StartServer(0, m_serverChatService.Port); } }
/// <summary> /// 启动服务 /// </summary> /// <param name="fileName">文件名</param> public static void StartService() { ReadPlots(); m_userCookieService = new UserCookieService(); m_exportService = new ExportService(); m_userSecurityService = new UserSecurityService(); m_eMSecurityService = new EMSecurityService(); bool loadAll = EMSecurityService.Load(); //BlockService.Load(loadAll); CFTService.Start(); SecurityService.Start(); }
/// <summary> /// 获取COOKIE /// </summary> /// <param name="var">变量</param> /// <returns>状态</returns> private double GETCOOKIE(CVariable var) { String cookieName = m_indicator.GetText(var.m_parameters[1]); UserCookieService cookieService = DataCenter.UserCookieService; UserCookie cookie = new UserCookie(); if (cookieService.GetCookie(cookieName, ref cookie) > 0) { CVariable newVar = new CVariable(m_indicator); newVar.m_expression = "'" + cookie.m_value + "'"; m_indicator.SetVariable(var.m_parameters[0], newVar); return(1); } return(0); }