⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shownotice.aspx.cs

📁 学生公寓管理系统使用说明: 1.服务器运行环境 SQL 2000 .NET FRAMEWORK 1.1 .NET FRAMEWORK 1.1 CHINESE (SIMPL
💻 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.Configuration;

namespace Manage
{
	/// <summary>
	/// ShowNotice 的摘要说明。
	/// </summary>
	public class ShowNotice : System.Web.UI.Page
	{
		protected string cmdText;
		protected string myConn;
		protected string id;
		protected System.Data.SqlClient.SqlConnection conn;
		protected System.Data.SqlClient.SqlCommand cmd;
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.Panel Panel1;
		protected System.Web.UI.WebControls.Panel Panel2;
			protected System.Data.SqlClient.SqlDataReader reader;
		
		

		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			StudentMenu sm=(StudentMenu)LoadControl("StudentMenu.ascx");
			ManagerMenu sk=(ManagerMenu)LoadControl("managerMenu.ascx");
			if(this.Session["kind"].ToString()=="学生")
				this.Panel1.Controls.Add(sm);
			else if(this.Session["kind"].ToString()=="管理员")
				this.Panel1.Controls.Add(sk);
			id=Request.QueryString.ToString();
			
			string s;
			this.myConn=ConfigurationSettings.AppSettings["mySql"];
			this.conn=new System.Data.SqlClient.SqlConnection(myConn);
			cmdText="select * from Info where Info_ID='"+id+"'";
			conn.Open();
			cmd=new System.Data.SqlClient.SqlCommand(cmdText,conn);
			reader=cmd.ExecuteReader();
			reader.Read();
			s="主题:"+reader["Info_Main"].ToString()+"<br>"+"内容 :"+reader["Info_Text"].ToString()+"<br>"+"信息类别:"+reader["Info_Kind"].ToString()+"<br>"+"发表日期:"+reader["Info_Date"].ToString();
			this.Label1.Text=s;
			reader.Close();
			conn.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 + -