这是用户登陆的代码:
bool bvalid = Users.Login(username.Text, Users.Encrypt(password.Text));
if (bvalid)
{
// Use security system to set the UserID within a client-side Cookie
FormsAuthentication.SetAuthCookie(username.Text, false);
Session["userID"] = username.Text;
// Redirect browser back to originating page
Response.Redirect("Default.aspx");
}
web.config设置如下:
<authentication mode="Forms">
<forms name="WebAuth" loginUrl="Default.aspx" protection="None" timeout="60" />
</authentication>我想用if (Request.IsAuthenticated == true)判断用户是否登陆, 怎么判断不了啊?
bool bvalid = Users.Login(username.Text, Users.Encrypt(password.Text));
if (bvalid)
{
// Use security system to set the UserID within a client-side Cookie
FormsAuthentication.SetAuthCookie(username.Text, false);
Session["userID"] = username.Text;
// Redirect browser back to originating page
Response.Redirect("Default.aspx");
}
web.config设置如下:
<authentication mode="Forms">
<forms name="WebAuth" loginUrl="Default.aspx" protection="None" timeout="60" />
</authentication>我想用if (Request.IsAuthenticated == true)判断用户是否登陆, 怎么判断不了啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货