温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:狂人论坛3.0源码
当前文件:
W3AWPMNK1EI77/admin_jianlogin.aspx.cs[2K,2009-6-12 11:57:59],打开代码结构图
W3AWPMNK1EI77/admin_jianlogin.aspx.cs[2K,2009-6-12 11:57:59],打开代码结构图1using System; 2
using System.Collections; 3
using System.ComponentModel; 4
using System.Data; 5
using System.Drawing; 6
using System.Web; 7
using System.Web.SessionState; 8
using System.Web.UI; 9
using System.Web.UI.WebControls; 10
using System.Web.UI.HtmlControls; 11
using System.Data.OleDb; 12
using System.Configuration; 13
using System.Text; 14
using System.Web.Security; 15
using System.Security.Cryptography; 16
17
namespace 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






}