您目前尚未登陆,请选择【登陆】或【注册
首页->新闻文章->三层新闻发布管理系统源码>>news2005/ascx/Login.ascx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:三层新闻发布管理系统源码
当前文件:文件类型 TreeLayerNews/news2005/ascx/Login.ascx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11 12public partial class ascx_Login : System.Web.UI.UserControl 13{ 14 Model.admin Ma = new Model.admin(); 15 BLL.admin Ba = new BLL.admin(); 16 17 protected void Page_Load(object sender, EventArgs e) 18 { 19 if (!Page.IsPostBack) 20 { 21 this.login_E.Visible = false; 22 } 23 } 24 protected void Cancel_Click(object sender, EventArgs e) 25 { 26 this.UserName.Text = ""; 27 this.PassWord.Text = ""; 28 this.UserName.Focus(); 29 } 30 protected void login_Click(object sender, EventArgs e) 31 { 32 Ma.username = this.UserName.Text.Trim(); 33 Ma.password = FormsAuthentication.HashPasswordForStoringInConfigFile(this.PassWord.Text.Trim(),"MD5"); 34 if (Ba.ReRowCount(Ma)>0) 35 { 36 Session["admin"] = Ma.username.ToString(); 37 Response.Redirect("../Web/admin/Admin_Index.aspx"); 38 } 39 if (Ba.UserLogin(Ma).Tables[0].Rows.Count>0) 40 { 41 Session["username"] = Ma.username.ToString(); 42 } 43 this.login_s.Visible = false; 44 this.login_E.Visible = true; 45 this.Label.Text = Session["username"].ToString(); 46 } 47 protected void Login_out_Click(object sender, EventArgs e) 48 { 49 this.login_s.Visible = true; 50 this.login_E.Visible = false; 51 Session.Clear(); 52 } 53} 54
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:三层新闻发布管理系统源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号