Asp.net源码专业站
首页->论坛社区->狂人论坛3.0源码>>admin_jianlogin.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:狂人论坛3.0源码
当前文件:文件类型 W3AWPMNK1EI77/admin_jianlogin.aspx.cs[2K,2009-6-12 11:57:59]打开代码结构图
普通视图
		            
1using System; 2using System.Collections; 3using System.ComponentModel; 4using System.Data; 5using System.Drawing; 6using System.Web; 7using System.Web.SessionState; 8using System.Web.UI; 9using System.Web.UI.WebControls; 10using System.Web.UI.HtmlControls; 11using System.Data.OleDb; 12using System.Configuration; 13using System.Text; 14using System.Web.Security; 15using System.Security.Cryptography; 16 17namespace kuangren 18{ 19 /// <summary> 20 /// admin_jianlogin 的摘要说明。 21 /// </summary> 22 public class admin_jianlogin : System.Web.UI.Page 23 { 24 protected System.Web.UI.WebControls.Label Label1; 25 protected System.Web.UI.WebControls.Label Label2; 26 protected System.Web.UI.WebControls.TextBox username; 27 protected System.Web.UI.WebControls.TextBox password; 28 protected System.Web.UI.WebControls.HyperLink HyperLink1; 29 protected System.Web.UI.WebControls.Button Button1; 30 public string username1; 31 public string password1; 32 protected System.Data.OleDb.OleDbCommand cmd; 33 protected System.Data.OleDb.OleDbConnection conn; 34 public DataSet dsuser; 35 public string error; 36 private void Page_Load(object sender, System.EventArgs e) 37 { 38 // 在此处放置用户代码以初始化页面 39 } 40 41 Web 窗体设计器生成的代码 62 63 private void Button1_Click(object sender, System.EventArgs e) 64 { 65 username1=""+username.Text+""; 66 password1=(FormsAuthentication.HashPasswordForStoringInConfigFile(password.Text.ToString().Trim(),"MD5")); 67 conn = new OleDbConnection(ConfigurationSettings.AppSettings["cnFriends.ConnectionString"]); 68 cmd=new OleDbCommand("select * from admin where usercount='"+username1+"' and password='"+password1+"'and power=8",conn); 69 dsuser=new DataSet(); 70 OleDbDataAdapter adWord=new OleDbDataAdapter("select * from admin where usercount='"+username1+"' and password='"+password1+"' and power=8",conn); 71 adWord.Fill(dsuser,"userinfo"); 72 73 OleDbDataReader objDataReader ; 74 cmd.Connection.Open(); 75 objDataReader = cmd.ExecuteReader(); 76 if (objDataReader.Read() == true) 77 { 78 Session["admjian"]=Convert.ToString(dsuser.Tables[0].Rows[0]["usercount"]); 79 Response.Redirect("admin_main.aspx"); 80 } 81 conn.Close(); 82 } 83 } 84} 85
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:狂人论坛3.0源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146