public ActionResult SendMsg(string mobile) { if (Convert.ToString(CacheHelper.GetCache("yz_" + Session.SessionID)) == "1") { return(Json(false)); } CacheHelper.Add2("yz_" + Session.SessionID, "1", new TimeSpan(0, 1, 0)); SMSHelperManager smsHelperMgr = new SMSHelperManager(); Random rd = new Random(Guid.NewGuid().GetHashCode()); int code = rd.Next(100000, 999999); string msgConten = string.Format(SMSContent, code);// "您的验证码为" + code + "切勿泄露给他人,有效期为5分钟(小童星俱乐部)"; CacheHelper.Add2("code_" + Session.SessionID, code, new TimeSpan(0, 5, 0)); smsHelperMgr.SendSMS(mobile, msgConten); return(Json(true)); }