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

📄 pith.aspx.cs

📁 一个C#写的WEB论坛
💻 CS
📖 第 1 页 / 共 2 页
字号:
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
			this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = @"SELECT Q_ID, author, Q_Note, Q_Content, ImageName, HiteCounter, AnsCounter, ReleaseTime, ReferTime, BigClass_ID, SmallClass_ID, kind FROM Questions WHERE (SmallClass_ID = @SmallClassID) AND (pith = 1) AND (kind > 0) AND (kind < 5) ORDER BY BigClass_ID DESC, SmallClass_ID DESC";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SmallClassID", System.Data.SqlDbType.Int, 4, "SmallClass_ID"));
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "workstation id=YRJ008;packet size=4096;user id=sa;initial catalog=doughty_Forum;" +
				"persist security info=True;password=123";
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = @"INSERT INTO Questions(Q_ID, author, Q_Note, Q_Content, ImageName, HiteCounter, AnsCounter, ReleaseTime, ReferTime, BigClass_ID, SmallClass_ID, Kind) VALUES (@Q_ID, @author, @Q_Note, @Q_Content, @ImageName, @HiteCounter, @AnsCounter, @ReleaseTime, @ReferTime, @BigClass_ID, @SmallClass_ID, @Kind); SELECT Q_ID, author, Q_Note, Q_Content, ImageName, HiteCounter, AnsCounter, ReleaseTime, ReferTime, BigClass_ID, SmallClass_ID, Kind FROM Questions WHERE (Q_ID = @Q_ID)";
			this.sqlInsertCommand1.Connection = this.sqlConnection1;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Q_ID", System.Data.SqlDbType.Int, 4, "Q_ID"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@author", System.Data.SqlDbType.VarChar, 20, "author"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Q_Note", System.Data.SqlDbType.VarChar, 160, "Q_Note"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Q_Content", System.Data.SqlDbType.NVarChar, 1073741823, "Q_Content"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ImageName", System.Data.SqlDbType.VarChar, 30, "ImageName"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HiteCounter", System.Data.SqlDbType.Int, 4, "HiteCounter"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AnsCounter", System.Data.SqlDbType.Int, 4, "AnsCounter"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReleaseTime", System.Data.SqlDbType.DateTime, 8, "ReleaseTime"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReferTime", System.Data.SqlDbType.DateTime, 8, "ReferTime"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BigClass_ID", System.Data.SqlDbType.Int, 4, "BigClass_ID"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SmallClass_ID", System.Data.SqlDbType.Int, 4, "SmallClass_ID"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Kind", System.Data.SqlDbType.Int, 4, "Kind"));
			// 
			// sqlUpdateCommand1
			// 
			this.sqlUpdateCommand1.CommandText = @"UPDATE Questions SET Q_ID = @Q_ID, author = @author, Q_Note = @Q_Note, Q_Content = @Q_Content, ImageName = @ImageName, HiteCounter = @HiteCounter, AnsCounter = @AnsCounter, ReleaseTime = @ReleaseTime, ReferTime = @ReferTime, BigClass_ID = @BigClass_ID, SmallClass_ID = @SmallClass_ID, Kind = @Kind WHERE (Q_ID = @Original_Q_ID) AND (AnsCounter = @Original_AnsCounter OR @Original_AnsCounter IS NULL AND AnsCounter IS NULL) AND (BigClass_ID = @Original_BigClass_ID OR @Original_BigClass_ID IS NULL AND BigClass_ID IS NULL) AND (HiteCounter = @Original_HiteCounter OR @Original_HiteCounter IS NULL AND HiteCounter IS NULL) AND (ImageName = @Original_ImageName OR @Original_ImageName IS NULL AND ImageName IS NULL) AND (Kind = @Original_Kind OR @Original_Kind IS NULL AND Kind IS NULL) AND (Q_Note = @Original_Q_Note OR @Original_Q_Note IS NULL AND Q_Note IS NULL) AND (ReferTime = @Original_ReferTime OR @Original_ReferTime IS NULL AND ReferTime IS NULL) AND (ReleaseTime = @Original_ReleaseTime OR @Original_ReleaseTime IS NULL AND ReleaseTime IS NULL) AND (SmallClass_ID = @Original_SmallClass_ID OR @Original_SmallClass_ID IS NULL AND SmallClass_ID IS NULL) AND (author = @Original_author OR @Original_author IS NULL AND author IS NULL); SELECT Q_ID, author, Q_Note, Q_Content, ImageName, HiteCounter, AnsCounter, ReleaseTime, ReferTime, BigClass_ID, SmallClass_ID, Kind FROM Questions WHERE (Q_ID = @Q_ID)";
			this.sqlUpdateCommand1.Connection = this.sqlConnection1;
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Q_ID", System.Data.SqlDbType.Int, 4, "Q_ID"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@author", System.Data.SqlDbType.VarChar, 20, "author"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Q_Note", System.Data.SqlDbType.VarChar, 160, "Q_Note"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Q_Content", System.Data.SqlDbType.NVarChar, 1073741823, "Q_Content"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ImageName", System.Data.SqlDbType.VarChar, 30, "ImageName"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HiteCounter", System.Data.SqlDbType.Int, 4, "HiteCounter"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AnsCounter", System.Data.SqlDbType.Int, 4, "AnsCounter"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReleaseTime", System.Data.SqlDbType.DateTime, 8, "ReleaseTime"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReferTime", System.Data.SqlDbType.DateTime, 8, "ReferTime"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BigClass_ID", System.Data.SqlDbType.Int, 4, "BigClass_ID"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SmallClass_ID", System.Data.SqlDbType.Int, 4, "SmallClass_ID"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Kind", System.Data.SqlDbType.Int, 4, "Kind"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Q_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Q_ID", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_AnsCounter", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "AnsCounter", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BigClass_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BigClass_ID", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HiteCounter", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "HiteCounter", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ImageName", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ImageName", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Kind", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Kind", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Q_Note", System.Data.SqlDbType.VarChar, 160, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Q_Note", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ReferTime", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ReferTime", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ReleaseTime", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ReleaseTime", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SmallClass_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "SmallClass_ID", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_author", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "author", System.Data.DataRowVersion.Original, null));
			// 
			// sqlDeleteCommand1
			// 
			this.sqlDeleteCommand1.CommandText = @"DELETE FROM Questions WHERE (Q_ID = @Original_Q_ID) AND (AnsCounter = @Original_AnsCounter OR @Original_AnsCounter IS NULL AND AnsCounter IS NULL) AND (BigClass_ID = @Original_BigClass_ID OR @Original_BigClass_ID IS NULL AND BigClass_ID IS NULL) AND (HiteCounter = @Original_HiteCounter OR @Original_HiteCounter IS NULL AND HiteCounter IS NULL) AND (ImageName = @Original_ImageName OR @Original_ImageName IS NULL AND ImageName IS NULL) AND (Kind = @Original_Kind OR @Original_Kind IS NULL AND Kind IS NULL) AND (Q_Note = @Original_Q_Note OR @Original_Q_Note IS NULL AND Q_Note IS NULL) AND (ReferTime = @Original_ReferTime OR @Original_ReferTime IS NULL AND ReferTime IS NULL) AND (ReleaseTime = @Original_ReleaseTime OR @Original_ReleaseTime IS NULL AND ReleaseTime IS NULL) AND (SmallClass_ID = @Original_SmallClass_ID OR @Original_SmallClass_ID IS NULL AND SmallClass_ID IS NULL) AND (author = @Original_author OR @Original_author IS NULL AND author IS NULL)";
			this.sqlDeleteCommand1.Connection = this.sqlConnection1;
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Q_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Q_ID", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_AnsCounter", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "AnsCounter", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BigClass_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "BigClass_ID", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HiteCounter", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "HiteCounter", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ImageName", System.Data.SqlDbType.VarChar, 30, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ImageName", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Kind", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Kind", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Q_Note", System.Data.SqlDbType.VarChar, 160, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Q_Note", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ReferTime", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ReferTime", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ReleaseTime", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ReleaseTime", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SmallClass_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "SmallClass_ID", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_author", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "author", System.Data.DataRowVersion.Original, null));
			// 
			// sqlDataAdapter1
			// 
			this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
			this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
			this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
			this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																									  new System.Data.Common.DataTableMapping("Table", "Questions", new System.Data.Common.DataColumnMapping[] {
																																																				   new System.Data.Common.DataColumnMapping("Q_ID", "Q_ID"),
																																																				   new System.Data.Common.DataColumnMapping("author", "author"),
																																																				   new System.Data.Common.DataColumnMapping("Q_Note", "Q_Note"),
																																																				   new System.Data.Common.DataColumnMapping("Q_Content", "Q_Content"),
																																																				   new System.Data.Common.DataColumnMapping("ImageName", "ImageName"),
																																																				   new System.Data.Common.DataColumnMapping("HiteCounter", "HiteCounter"),
																																																				   new System.Data.Common.DataColumnMapping("AnsCounter", "AnsCounter"),
																																																				   new System.Data.Common.DataColumnMapping("ReleaseTime", "ReleaseTime"),
																																																				   new System.Data.Common.DataColumnMapping("ReferTime", "ReferTime"),
																																																				   new System.Data.Common.DataColumnMapping("BigClass_ID", "BigClass_ID"),
																																																				   new System.Data.Common.DataColumnMapping("SmallClass_ID", "SmallClass_ID"),
																																																				   new System.Data.Common.DataColumnMapping("Kind", "Kind")})});
			this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;

		}
		#endregion

		protected void Button5_Click(object sender, System.EventArgs e)
		{
			try
			{
				int x = System.Convert.ToInt32(TextBox1.Text.ToString());
				string BID,SID;
				if (Request.QueryString["BID"]==null)
				{
					BID="1";
					SID="200";
				}
				else
				{
					BID=Request.QueryString["BID"];
					SID=Request.QueryString["SID"];
				}
				string s=Request.CurrentExecutionFilePath+"?BID="+BID.ToString()+ "&SID="+ SID.ToString()+"&Page="+Convert.ToString(x);
				this.Response.Redirect(s);
			}
			catch(Exception) 
			{
			}
		}
	}
}

⌨️ 快捷键说明

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