有验证码的登陆界面(ajax,ashx技术制作)(7)
}
}
//判断用户名密码是否正确
[AjaxPro.AjaxMethod] //该方式不能读写Session
public int isRight(string userName, string userPwd)
{
int count = 0;
if (userName == "system" && userPwd == "8246")
{
count = 1;
}
else {
count = 0;
}
return count;
/*
//对于 Applciation,和request的操作 不能直接读取,得前缀HttpContext.Current
string str1=Application["App"]; //error
string str2=Request["Req"]; //error
string str3=HttpContext.Current.Application["App"]; //right
string str3=HttpContext.Current.Request["Req"]; //right
*/
}
//判断验证码是否正确
[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)] // 可以读写Session:
public string CheckCode(string checkcode)
{
string _checkcode = "NO";
if (Session["CheckCode"].ToString().ToUpper() == checkcode)
{
_checkcode = "YES";
相关新闻>>
- 发表评论
-
- 最新评论 更多>>