Visual Studio 2012 警告该类的第一行已过时:
if (FormsAuthentication.Authenticate(UserName.Text, Password.Text) == true)
public void LoginClass(object s, EventArgs e)
{
if (FormsAuthentication.Authenticate(UserName.Text, Password.Text) == true)
{
FormsAuthentication.SetAuthCookie(UserName.Text, true);
Response.Redirect("admin/default.aspx");
}
else
{
if (DBAuthenticate(UserName.Text, Password.Text))
{
FormsAuthentication.SetAuthCookie(UserName.Text, true);
Response.Redirect("members/default.aspx");
}
else
{
LtlLogin.Text = "<p>Sorry wrong login details</p>";
}
}
}
我会很感激一些帮助。我应该用什么替换框架 4.5 中的这行代码?