您目前尚未登陆,请选择【登陆】或【注册
首页->其他源码->商务维基网源码>>adminLogin.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:商务维基网源码
当前文件:文件类型 MerchantViki/adminLogin.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Data.SqlClient; 4using System.Configuration; 5using System.Collections; 6using System.Web; 7using System.Web.Security; 8using System.Web.UI; 9using System.Web.UI.WebControls; 10using System.Web.UI.WebControls.WebParts; 11using System.Web.UI.HtmlControls; 12//该源码下载自www.51aspx.com(51aspx.com) 13 14public partial class SysConfigure : System.Web.UI.Page 15{ 16 protected void Page_Load(object sender, EventArgs e) 17 { 18 this.Header.Title = Application.Get("siteName") + "---" + this.Header.Title; 19 } 20 21 private string StringFilter(string inStr) 22 { 23 string outStr; 24 outStr = inStr.Trim().Replace("\'", ""); 25 return outStr; 26 } 27 28 protected void AdminLoginBtn_Click(object sender, EventArgs e) 29 { 30 if (Page.IsValid) 31 { 32 try 33 { 34 string conStr = Application.Get("conStr").ToString(); 35 SqlConnection sqlCon = new SqlConnection(conStr); 36 sqlCon.Open(); 37 38 string pwd = StringFilter(adminPwd.Text); 39 string pwdMD5 = FormsAuthentication.HashPasswordForStoringInConfigFile(pwd,"MD5").ToString(); 40 41 string cmdStr = "select value from conf where type = 'adminPwd' and value = '"+pwdMD5+"'"; 42 SqlCommand sqlCmd = new SqlCommand(cmdStr, sqlCon); 43 SqlDataReader sqlDR = sqlCmd.ExecuteReader(); 44 45 bool isLogin = false; 46 47 if (sqlDR.Read()) 48 { 49 Session.Add("admin", "true"); 50 Response.Redirect("sysconfigure.aspx"); 51 } 52 else 53 { 54 info.Text = "口令错误!"; 55 } 56 57 sqlDR.Close(); 58 sqlCon.Close(); 59 } 60 catch (Exception ex) 61 { 62 info.Text = "系统操纵错误:" + ex.Message; 63 } 64 } 65 } 66} 67
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:商务维基网源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号