📄 main.aspx.cs
字号:
using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.HtmlControls;using System.Data.OleDb;namespace Lb_news{ /// <summary> /// main 的摘要说明。 /// </summary> public class main : System.Web.UI.Page { protected System.Web.UI.WebControls.TextBox LbNews_ClassName; protected System.Web.UI.WebControls.RequiredFieldValidator required1; protected System.Web.UI.WebControls.Button Submit; public int grade; protected Conn ds1=new Conn(); protected OleDbDataReader rd; protected DataSet ds; protected int NewsCount; protected int NewsPicCount; protected int NewsCheckCount; protected int InputUserCount; protected int CheckUserCount; protected int AdminUserCount; protected string LbUserName; protected string LbUserGrade; protected int UserNews; private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 ds1.CheckCookies(1); grade=ds1.grade; Lb_Count(); popedom(); } private void Lb_Count() { ds1.DBopen(); //新闻总数 rd=ds1.ExecuteOleDbDataReader("select count(*) from Lb_News"); rd.Read(); NewsCount=rd.GetInt32(0); rd.Close(); //图片新闻总数 rd=ds1.ExecuteOleDbDataReader("select count(*) from Lb_News where n_ispic=1"); rd.Read(); NewsPicCount=rd.GetInt32(0); rd.Close(); //未审核新闻总数 rd=ds1.ExecuteOleDbDataReader("select count(*) from Lb_News where n_check=0"); rd.Read(); NewsCheckCount=rd.GetInt32(0); rd.Close(); //输入员总数 rd=ds1.ExecuteOleDbDataReader("select count(*) from Lb_Admin where A_Grade=1"); rd.Read(); InputUserCount=rd.GetInt32(0); rd.Close(); //审核员总数 rd=ds1.ExecuteOleDbDataReader("select count(*) from Lb_Admin where A_Grade=2"); rd.Read(); CheckUserCount=rd.GetInt32(0); rd.Close(); //管理员总数 rd=ds1.ExecuteOleDbDataReader("select count(*) from Lb_Admin where A_Grade=3"); rd.Read(); AdminUserCount=rd.GetInt32(0); rd.Close(); ds1.DBclose(); } private void popedom() { HttpCookie cookie=Request.Cookies["UserInfo"]; LbUserGrade=cookie.Values["grade"].ToString(); LbUserName=cookie.Values["username"].ToString(); ds1.DBopen(); rd=ds1.ExecuteOleDbDataReader("select count(*) from Lb_News where n_publisher='"+LbUserName+"'"); rd.Read(); UserNews=rd.GetInt32(0); rd.Close(); } #region Web 窗体设计器生成的代码 override protected void OnInit(EventArgs e) { // // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。 // InitializeComponent(); base.OnInit(e); } /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -