.NET MVC 保存Session值,6位数验证码

//6位数验证码:
Random rm = new Random();
string str = rm.Next(100000, 1000000).ToString();
//MVC控制器Action中 保存session值
System.Web.HttpContext.Current.Session["Code"] = str;
//MVC控制器Action中 读取session值
string SessingStr = System.Web.HttpContext.Current.Session["Code"].ToString();
原文地址:https://www.cnblogs.com/SeNaiTes/p/8916065.html