Exemplo n.º 1
0
        private void FillAgent()
        {
            var agent = new { UserAgent = Request.UserAgent, Platform = Request.Browser.Platform, Version = Request.Browser.Version, BrowserName = Request.Browser.Browser, BrowserType = Request.Browser.Type, IPAddress = Request.UserHostAddress };

            HttpContext.Session["IP"] = Request.UserHostAddress;
            PlatformAgent.Set(JsonConvert.SerializeObject(agent));
        }
Exemplo n.º 2
0
        public static PlatformAgent Get()
        {
            if (_instance == null)
            {
                lock (_locker)
                {
                    if (_instance == null)
                    {
                        _instance = new PlatformAgent();
                    }
                }
            }

            return(_instance);
        }
Exemplo n.º 3
0
 public static void Set(string jsonStr)
 {
     _instance = JsonConvert.DeserializeObject <PlatformAgent>(jsonStr);
 }