问个登陆的问题
username = Request.QueryString["username"];
password = Request.QueryString["password"];
if (username == "" || password == "")
{
Response.Redirect("index.aspx");
}
string sql = "select Username from member where Username='"+username+"'";
SqlConnection con = new SqlConnection(connstr);
con.Open();
SqlCommand com = new SqlCommand(sql,con);
SqlDataReader read = com.ExecuteReader();
if (read.Read())
{
username = read["Username"].ToString();
read.Close();
string pwd1 = FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5"); //ASCIIEncoding.ASCII.GetString(HashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(password)));
string strsql = "Select Active, Valid, LoginTime, SCCPoint From member where Username = '" +username + "' and Password = '" +pwd1+ "'";
com = new SqlCommand(strsql,con);
read = com.ExecuteReader();
if (read.Read())
{
string active = read["Active"].ToString();
string valid = read["Valid"].ToString();
if (active == "True")
{
if (valid == "True")
{
if (read["LoginTime"].ToString() == DateTime.Now.ToString())
{
SCCPoint_Increase = 1;
}
else
{
SCCPoint_Increase = 0;
}
string strupdate = "Update member Set LoginTime ='" + DateTime.Now.ToString() + "', LoginIP = '" + Context.Request.UserHostAddress.ToString() + "', SCCPoint = SCCPoint + '" + SCCPoint_Increase+"' Where Username = '" + username + "'";
com = new SqlCommand(strupdate, con);
read.Close();
if (com.ExecuteNonQuery() > 0)
{
HttpCookie cookie = new HttpCookie("userCookie");
cookie.Values.Add("userName", username);
cookie.Values.Add("userPwd", pwd1);
//cookie.Expires = DateTime.Now.AddHours(3);
Response.AppendCookie(cookie);
con.Close();
Response.Redirect("./User/surveycenter.aspx");
}
}
else
{
con.Close();
Session["message"] = "您的账户存在问题,通常是存在多账户情况。多账户包括:1、一个自然人注册(或使用)一个以上的账户;2、一个家庭注册(或使用)一个以上的账户;3、一个办公室(宿舍等)使用相同IP注册(或使用)一个以上的账户;4、同一台计算机上注册(或使用)一个以上的账户。请联系管理员,注意信中包含您的会员名,且不要用 21cn.com/sina.com/sohu.com/tom.com 的信箱来信,或访问论坛 <a href='http://bbs.surveys.com.cn'>http://bbs.surveys.com.cn</a> 提问";
Response.Redirect("fail.aspx");
}
}
else
{
con.Close();
Session["message"] = "您的账户未激活,请您激活账户后登陆";
Response.Redirect("fail.aspx");
}
}
else
{
con.Close();
Session["message"] = "密码错误,请重新输入";
Response.Redirect("fail.aspx");
}
}
else
{
con.Close();
Session["message"] = "没有此用户名,请您注册后登陆";
Response.Redirect("fail.aspx");
}
我在单机运行没有问题,登陆很快,但是发到FTP上之后,登陆就登陆不上去了,总显示登录超时,我连接的是网上的数据库
请问这个要如何解决?或者是我代码哪里写的不对了?请高手指教
...全文
相关推荐
姆町开源验证单码登陆修复报错及对接讲解-易语言
修复了下单码登陆报错的问题,原因是后台存储机器码的时候,是调用到了token中存储的机器码,但是调用登陆的时候,token是下发的,登陆接口并没有携带token,所以就取不到机器码了。 其它的我发现的问题也一并修复了,对接源码自行下载。 开源的后台,决定用的人记得修改下服务器根目录下面的password.php里面的key跟iv,长度保持一致 就行了,不然会怎么样我也不说了。
传世登陆器源码
清风登陆器源码,易语言供大家研究研究.易语言个人不太会,有能研究支持新端的希望分享出来哦
AD技巧之指定用户登录和指定计算机登陆.doc
AD技巧之指定用户登录和指定计算机登陆
JieLink百问百答--常见问题篇
Jielink百问百答——常见问题篇
解决LOL登陆黑屏问题
对于登陆LOL黑屏问题的解决: 1、以管理员的身份执行本文上传的脚本 登陆LOL如果问题没解决则执行下一步 2、运行TGP助手修复功能 最后完美解决黑屏问题


