.NET MVC 保存Session值,6位数验证码
生活随笔
收集整理的這篇文章主要介紹了
.NET MVC 保存Session值,6位数验证码
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
//6位數(shù)驗證碼:
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();
//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
總結
以上是生活随笔為你收集整理的.NET MVC 保存Session值,6位数验证码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 移动端
- 下一篇: 解决pycharm安装包过程出现的问题: