예제 #1
0
        public ActionResult AppLogin(AppData jsonString)
        {
            string clientId = redis.Get("1234567890");

            //Login by uid
            var _instance = GlobalHost.ConnectionManager.GetHubContext("QrHub").Clients;

            _instance.Client(clientId).broadcastMessage("200", "success");

            JObject result = new JObject();

            result.Add("flag", true);

            return(Json(result));
        }
예제 #2
0
        public string GetStr(string key)
        {
            string result = "";

            try
            {
                DoRedisString rs = new DoRedisString();
                result = rs.Get(key);
                if (result == null)
                {
                    SetStr(key, "tom");
                }
                result = rs.Get(key);
            }
            catch (Exception ex)
            {
                result = ex.Message;
            }
            return(result);
        }