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

📄 top.ascx.cs

📁 如果遇到MD5加密文件(一般都是这个)
💻 CS
字号:
namespace Lb_news{	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;	using System.Text;	/// <summary>	///		top 的摘要说明。	/// </summary>	public class top : System.Web.UI.UserControl	{		protected System.Web.UI.WebControls.Label CssTest;		protected System.Web.UI.WebControls.DropDownList ddl_css;		public string Style_css;		protected string Lb_logo;		protected string Lb_banner;		protected System.Web.UI.WebControls.Button Button1; 		protected UrlFormat urlFormat=new UrlFormat();				protected Conn ds1=new Conn();		protected  OleDbDataReader rd;		protected  DataSet ds;      		private void Page_Load(object sender, System.EventArgs e)		{			// 在此处放置用户代码以初始化页面			if (!Page.IsPostBack)			{  				Listddl_css();							}    			Lb_Css();         		}						private void Lb_Css()		{			ds1.DBopen();			rd=ds1.ExecuteOleDbDataReader("select * from Lb_Setup");   			if(rd.HasRows)			{									rd.Read();				Lb_logo=rd.GetString(3);				Lb_banner=rd.GetString(4);				rd.Close();			}			else			{				Response.Write	("暂时没有记录");			}															if (Request.Cookies["Next_css"]==null)			{ 									Def_css();							}			else			{				HttpCookie cookie=Request.Cookies["Next_css"];                    				Style_css=cookie.Values["css2"].ToString();		          			}			ds1.DBclose();						}		private void Listddl_css()		{			 			ds1.DBopen();			ds=ds1.CreateDataSet("select * from Lb_Skins","Skins");			ddl_css.DataSource=ds;						ddl_css.DataTextField="S_Name";			ddl_css.DataValueField="S_Css";			ddl_css.DataBind();			ListItem Skins1=new ListItem("请自选风格");  //增加一个空白项,并使之位于首位。					ddl_css.Items.Insert(0,Skins1);						ds1.DBclose();				}		public void ViewClass()		{			ds1.DBopen();        			rd=ds1.ExecuteOleDbDataReader("select * from Lb_Class");   						if (rd.HasRows)			{				while(rd.Read())				{					Response.Write ("<a href="+urlFormat.ClassUrl(rd.GetInt32(0))+"><font bold=true>"+rd.GetString(1)+"</font></a>&nbsp;&nbsp;&nbsp;");				}						rd.Close();							}			else			{							Response.Write	("暂时没有记录");			}						ds1.DBclose();		}		private void Def_css() 		{			try			{				ds1.DBopen();				rd=ds1.ExecuteOleDbDataReader("select * from Lb_Skins where S_Isdef=1");   				if(rd.HasRows)				{										rd.Read();					Style_css=rd.GetString(3);					rd.Close();				}				else				{					Response.Write	("暂时没有记录");				}						}			catch(System.Data.OleDb.OleDbException e)			{				Response.Write (e.ToString());			}						finally			{				ds1.DBclose();			}			}		#region Web 窗体设计器生成的代码		override protected void OnInit(EventArgs e)		{			//			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。			//			InitializeComponent();			base.OnInit(e);		}				/// <summary>		///		设计器支持所需的方法 - 不要使用代码编辑器		///		修改此方法的内容。		/// </summary>		private void InitializeComponent()		{			this.ddl_css.SelectedIndexChanged += new System.EventHandler(this.ddl_css_SelectedIndexChanged_2);			this.Load += new System.EventHandler(this.Page_Load);		}		#endregion		private void ddl_css_SelectedIndexChanged_2(object sender, System.EventArgs e)		{						HttpCookie MyCookies;					MyCookies=new HttpCookie("Next_css");			MyCookies.Values.Add("css2",ddl_css.SelectedItem.Value.ToString());			Response.AppendCookie(MyCookies);     			MyCookies.Expires=DateTime.MaxValue;			HttpCookie cookie=Request.Cookies["Next_css"];                    			Style_css=cookie.Values["css2"].ToString();					/*			 保持当前url,改变风格 			string PageName=Request.Url.ToString().Substring(Request.Url.ToString().LastIndexOf("/")+1);						//Response.Write ("<script>location.href('"+PageName+"');</script>");			*/			Response.Redirect ("index.aspx");		}	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -