/// <summary> /// 获取用户名 /// </summary> public string UserName { get { HttpCookie _cookie = Request.Cookies["User"]; if (_cookie == null) return ""; else return _cookie["UserName"]; } }
好了,浏览器中预览一下
测试一下,OK,大功告成!
/// <summary> /// 获取用户名 /// </summary> public string UserName { get { HttpCookie _cookie = Request.Cookies["User"]; if (_cookie == null) return ""; else return _cookie["UserName"]; } }
好了,浏览器中预览一下
测试一下,OK,大功告成!
内容版权声明:除非注明,否则皆为本站原创文章。