找传奇、传世资源到传世资源站!

asp.net 三层架构简单登录功能实现(入门级示例)

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

实现了 登陆 以及增删改查功能,非常入门级,直接附加test数据库即可,数据库在web/app_data文件夹下
from clipboard
from clipboard
from clipboard
using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using SystemModel;using SystemBLL;public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void LinkButton1_Click(object sender, EventArgs e) { DataSet dataSet = BLL.Login(this.TextBox1.Text, this.TextBox2.Text); if (dataSet.Tables["s"].Rows.Count > 0) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('登录成功!');</script>"); Response.Redirect("test.aspx"); } else { Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('登录失败!');</script>"); } } protected void LinkButton2_Click(object sender, EventArgs e) { this.TextBox1.Text = null; this.TextBox2.Text = null; }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复