温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:网博直销系统软件源码
当前文件:
WangBoDirect/App_Code/login.cs,打开代码结构图
WangBoDirect/App_Code/login.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Data.OleDb; 4
using System.Configuration; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
12
13
/// <summary> 14
/// login 的摘要说明 15
/// </summary> 16
public class login 17
{ 18
public login() 19
{ 20
// 21
// TODO: 在此处添加构造函数逻辑 22
//欢迎各位测试,并提出宝贵意见 23
// 此软件的后继版本正紧张开发中,网博承诺此软件完全开放代源码,并供大家免费使用 24
// 您可以在以下QQ群中得到免费的技术支持与学习机会 25
// 群:3920122(网博资讯2)3742047(网博资讯3)8261396(网博资讯4)9884297(网博资讯5) 26
// ------------------------------------------------------------------------------------------------- 27
28
//业务联系: 29
30
//QQ咨询405098219 100108980 31
//联系电话:0898- 69208466 69206466 13518884166 13518800346 32
//E-mail:webhww@126.com 33
} 34
public static void admin(string usn, string pwd) 35
{ 36
string sql = "SELECT * FROM admin where username='" + usn + "' and userpassword='" + pwd + "'"; 37
DataTable dt = access.GreatDs(sql).Tables[0]; 38
if (dt.Rows.Count > 0) 39
{ 40
41
System.Web.HttpContext.Current.Session["uid"] = dt.Rows[0]["id"]; 42
43
System.Web.HttpContext.Current.Response.Write("<script>location.href='index.htm';alert('登录成功');</script>"); 44
45
} 46
else 47
{ System.Web.HttpContext.Current.Response.Write("<script>alert('用户名或密码错误');</script>"); } 48
49
} 50
public static void reception(string usn, string pwd) 51
{ 52
string sql = "SELECT * FROM reception where reception_name='" + usn + "' and reception_password='" + pwd + "'"; 53
DataTable dt = access.GreatDs(sql).Tables[0]; 54
if (dt.Rows.Count > 0) 55
{ 56
57
System.Web.HttpContext.Current.Session["jid"] = dt.Rows[0]["id"]; 58
System.Web.HttpContext.Current.Session["reception_name"] = dt.Rows[0]["reception_name"]; 59
System.Web.HttpContext.Current.Response.Write("<script>location.href='jdd.aspx';alert('登录成功');</script>"); 60
61
} 62
else 63
{ System.Web.HttpContext.Current.Response.Write("<script>alert('用户名或密码错误');</script>"); } 64
65
} 66
public static void Out() 67
{ 68
System.Web.HttpContext.Current.Session.Clear(); 69
System.Web.HttpContext.Current.Response.Write("<script>top.location.href='../login.aspx';</script>"); 70
System.Web.HttpContext.Current.Response.End(); 71
} 72
public static void aOut() 73
{ 74
System.Web.HttpContext.Current.Session.Clear(); 75
System.Web.HttpContext.Current.Response.Write("<script>top.location.href='login.aspx';</script>"); 76
System.Web.HttpContext.Current.Response.End(); 77
} 78
public static void getpass(string usn) 79
{ 80
string sql = "SELECT id,question,solution FROM usercenter where username='" + usn + "'"; 81
DataTable dt = access.GreatDs(sql).Tables[0]; 82
if (dt.Rows.Count > 0) 83
{ 84
System.Web.HttpContext.Current.Session["usn"] = dt.Rows[0]["question"]; 85
System.Web.HttpContext.Current.Session["so"] = dt.Rows[0]["solution"]; 86
string question=dt.Rows[0]["question"].ToString(); 87
System.Web.HttpContext.Current.Response.Write("<script>location.href='UserReg.aspx?id=question';</script>"); 88
} 89
else 90
{ System.Web.HttpContext.Current.Response.Write("用户名错误"); } 91
92
} 93
} 94








