温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:简单用户管理源码(入门级)
当前文件:
SimpleUserManager/Default.aspx.cs[1K,2009-6-12 11:54:09],打开代码结构图
SimpleUserManager/Default.aspx.cs[1K,2009-6-12 11:54:09],打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Web; 5
using System.Web.Security; 6
using System.Web.UI; 7
using System.Web.UI.WebControls; 8
using System.Web.UI.WebControls.WebParts; 9
using System.Web.UI.HtmlControls; 10
//该源码下载自www.51aspx.com(51aspx.com) 11
12
public partial class _Default : System.Web.UI.Page 13
{ 14
protected void Page_Load(object sender, EventArgs e) 15
{ 16
17
} 18
protected void Button1_Click(object sender, EventArgs e) 19
{ 20
string _username= username.Text; 21
string _userpwd = userpwd.Text; 22
if ((_username != string.Empty) && (_userpwd != string.Empty)) 23
{ 24
25
Info info = new Info(); 26
info.Name = _username; 27
info.Pwd = _userpwd; 28
Dal dal = new Dal(); 29
DataTable Dt = dal.CheckLogin(info); 30
if (Dt.Rows.Count > 0) 31
{ 32
Session["Logins"] = _username; 33
Jscript.AlertAndRedirect("登陆成功!","View.aspx"); 34
35
} 36
else 37
{ 38
Jscript.Alert("登陆失败!"); 39
} 40
} 41
else 42
{ 43
Jscript.Alert("检测是否为空"); 44
} 45
} 46
} 47






}
}