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

📄 chakanxintie.aspx.cs

📁 简易BBS源码,包括系统管理、论坛管理、用户可以看懂源码
💻 CS
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data.SqlClient;
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;

namespace free.bbs
{
	/// <summary>
	/// Summary description for chakanxintie.
	/// </summary>
	public partial class chakanxintie : System.Web.UI.Page
	{
		protected System.Data.SqlClient.SqlConnection myconn;	
		protected System.Data.SqlClient.SqlCommand mycomm;
		DateTime now=DateTime.Now;
		DateTime now2=DateTime.Now;
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			shijian.Text=now.ToString("yyyy-MM-dd");
			time.Text=now.ToString("hh:mm");
			bangding();
		}

		private void bangding()
		{
			
			string mysql="SELECT posts.postid,posts.yonghuming,posts.zhuti,ancestor.neirong,posts.ancestor_id FROM posts,ancestor  WHERE ancestor.ancestor_id=posts.ancestor_id and posts.shijian>='"+now.Date+"'ORDER BY posts.postid DESC";
			myconn=new SqlConnection(Session["str_connection"].ToString());
			myconn.Open();
			SqlDataAdapter myadapter=new SqlDataAdapter(mysql,myconn);
			DataSet mydataset=new DataSet();
			myadapter.Fill(mydataset,"posts");
			mydatagrid.DataSource = mydataset.Tables["posts"].DefaultView;
			mydatagrid.DataBind();
			myconn.Close();
		}
		public void ChangePage(Object sender,DataGridPageChangedEventArgs e)
		{
			mydatagrid.CurrentPageIndex = e.NewPageIndex;
			bangding();
		}


		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    

		}
		#endregion
	}
}

⌨️ 快捷键说明

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