关于登录页面(记住我) [英] About Login Page (Remember Me)

查看:187
本文介绍了关于登录页面(记住我)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(您的登录名")是什么意思??

Login.aspx.cs

What do you mean by ("YourApplogin")???

Login.aspx.cs

if (chkRemember.Checked)
{
    HttpCookie cookie = new HttpCookie("YourAppLogin");
    cookie.Values.Add("username", txtUsername.Text);
    cookie.Expires = DateTime.Now.AddDays(15);
    Response.Cookies.Add(cookie);
}



还有
你是什​​么意思?
现在,您应该将此代码添加到需要登录的每个页面中:



And
What do you mean by???
Now you should add this code to every page that requires login :

if (Request.Cookies["YourApLogin&"] != null)
{
string username = Request.Cookies["YourAppLogin"].Values["username"]);
}

推荐答案

我的猜想,YourAppLogin是您的应用程序登录名的缩写.这只是标识Cookie的名称.
YourAppLogin is, I guess, short for Your Application Login. This is simply a name to identify that Cookie.


您的Applogin在此处是cookie名称.
YourApplogin is cookie name here.


这篇关于关于登录页面(记住我)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆