MasterPage2.master.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using ClassLibrary1;
using ClassLibrary2;
public partial class MasterPage2 : System.Web.UI.MasterPage
{
string str = System.Configuration.ConfigurationManager.AppSettings["str_con"].ToString(); //连接数据库
SqlConnection con = null;
SqlCommand cmd = null;
protected void Page_Load(object sender, EventArgs e)
{
L_online.Text = "本站当前有:<b>" + Application["user_sessions"].ToString() + "" + "</b>位访问者!";
if (!IsPostBack)
{
HttpCookie cookie = Request.Cookies["USER_COOKIE"];
if (cookie != null)
{
this.username.Text = cookie["UserName"];
this.password.Attributes.Add("value", cookie["UserPassword"]);
this.cb_pwd.Checked = true;//选中记住密码
}
if (Session["login"] != null)
{
L_display.Text = display_value.relname;
Image1.ImageUrl = display_value.image;
Panel1.Visible = true;
Panel2.Visible = false;
}
else
{
Panel1.Visible = false;
Panel2.Visible = true;
}
}
}
protected void but_login_Click(object sender, ImageClickEventArgs e)//登录
{
string user = username.Text.ToString();
string pwd = password.Text.ToString();
rember_pwd(); //记住密码
if (radio_admin.Checked)
{
con = new SqlConnection(str);
string sql = "SELECT [adminUser],[userPwd],[photo] FROM [dbo].[管理员信息表] WHERE adminUser='" + user + "' and userPwd='" + pwd + "'";
con.Open();
cmd = new SqlCommand(sql, con);
if (cmd.ExecuteScalar() != null)
{
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
Value.adminyhm = dr["adminUser"].ToString();
Value.photo=dr["photo"].ToString();
dr.Close();
后面还有 137 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。