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)); }
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); }