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

📄 huifu.aspx.cs

📁 简易BBS源码,包括系统管理、论坛管理、用户可以看懂源码
💻 CS
📖 第 1 页 / 共 2 页
字号:
					string qianming_pic;
					if(ds.Tables[0].Rows[i]["showqianming"].ToString()=="1")
					{
						qianming_pic="<b>我的签名:</b><br><FONT color=#66cc99>"+htmldecode(ds.Tables[0].Rows[i]["qianming"].ToString())+"</font><br><IMG src="+ds.Tables[0].Rows[i]["qianming_pic"].ToString()+"border=0>";
					}
					else
					{
						qianming_pic="";
					
					}

					Session["huifu"]+="<font face='宋体'><hr color=Gray  size=1  ><LI>"+qianming_pic+"</font></td></tr>";
					Session["huifu"]+="<tr><td "+css+"' ><font face='宋体'><IMG src='./images/ip.gif' border=0>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp"+ds.Tables["huifu"].Rows[i]["shijian"].ToString()+"</font></td>";
					Session["huifu"]+="<td "+css+"'><A href='bianji_huitie.aspx?huifu_id="+ds.Tables[0].Rows[i]["huifu_id"].ToString()+"'target=_blank title=编辑这个贴子><FONT size=2><IMG  src='./images/edit.gif' align=absMiddle border=0></FONT></A></td></tr></table>";
				}
				Session["npage"]="";
				Session["nPageCount"]="";
				Session["Record_Per_Page"]="";
				Session["nRecCount"]="";
				Session["fenye"]="";


				Session["npage"]=nPage;
				Session["nPageCount"]=nPageCount;
				Session["Record_Per_Page"]=Record_Per_Page;
				Session["nRecCount"]=nRecCount;
				Session["fenye"]=Set_daohang();
			}

			SqlCommand cmd=new SqlCommand("select neirong from ancestor where ancestor_id='"+Request.Params["ancestor_id"].ToString()+"'",myconn);
			SqlDataReader r;
			r=cmd.ExecuteReader();
			if(r.Read())
			{
				Session["title"]=r["neirong"].ToString().Trim()+"  "+Session["title"];
				Session["leibie"]=r["neirong"].ToString().Trim();
			}
			r.Close();
			myconn.Close();


		}

		#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()
		{    
			this.xiazai.Click += new System.Web.UI.ImageClickEventHandler(this.xiazai_Click);
		}
		#endregion



		private void xiazai_Click(object sender, System.Web.UI.ImageClickEventArgs e)
		{
			myconn.Open();
			SqlCommand comm=new SqlCommand("select lujing,attachfileext,attachfile from posts where postid='"+Request.Params["post_id"]+"'",myconn);
			SqlDataReader r;
			r=comm.ExecuteReader();
			r.Read();
			string houzhui=r["attachfileext"].ToString().Trim();   
			string FileName=r["attachfile"].ToString().Trim();
			string filePath =r["lujing"].ToString()+FileName; 
			if(File.Exists(filePath) == false)
			{ 				
				Response.Redirect ("download_wrong.aspx");
				return;

			}
			else
			{
				Page.Response.Clear();
				Page.Response.AddHeader( "Content-Type", houzhui);
				Page.Response.AddHeader("Content-Disposition", "attachment;filename=" + FileName);
				Page.Response.WriteFile(filePath);
				Page.Response.End();
				r.Close();
			}
			myconn.Close();


		}

		protected void Submit3_ServerClick(object sender, System.EventArgs e)
		{
			Info.Value="";
		}

		

		protected void Submit1_ServerClick(object sender, System.EventArgs e)
		{
			string huiyuan1;
			try 
			{
				huiyuan1=Request.Cookies["free_huiyuan"].Value.ToString();
				
			}
			catch 
			{
				Response.Redirect("error.aspx");
			}

			myconn.Open();
			mycomm=new SqlCommand("select islock from ancestor where ancestor_id="+Request.Params["ancestor_id"]+"",myconn);
			SqlDataReader myread=mycomm.ExecuteReader();
			try
			{
				myread.Read();
				if(myread["islock"].ToString()=="1")
				{
					Response.Write("<script>alert('对不起,该论坛模块已经被锁定,不能回复>')</script>");
					myread.Close();
					myconn.Close();
				}
				else
				{
					myread.Close();
					mycomm=new SqlCommand("select islock from posts where postid="+Request.Params["post_id"]+"",myconn);
					SqlDataReader myread1=mycomm.ExecuteReader();
					try
					{
						myread1.Read();
						if(myread1["islock"].ToString()=="1")
						{
							Response.Write("<script>alert('对不起,该主题已经被锁定,不能回复>')</script>");
							myread1.Close();
							myconn.Close();
							
						}
						else
						{
							myread1.Close();
							
							string lujing="";
							if(biaoqing1.Checked==true)
							{
			
								lujing=@"./emotion/emotion-1.gif";

							}   
							else if(biaoqing2.Checked==true)
							{
			
								lujing=@"./emotion/emotion-2.gif";
							}
							else if(biaoqing3.Checked==true)
							{
			
								lujing=@"./emotion/emotion-3.gif";
							}
							else if(biaoqing4.Checked==true)
							{
		
								lujing=@"./emotion/emotion-4.gif";
							}
							else if(biaoqing5.Checked==true)
							{
								lujing=@"./emotion/emotion-5.gif";
							}
							else if(biaoqing6.Checked==true)
							{
								lujing=@"./emotion/emotion-6.gif";
							}
							else if(biaoqing7.Checked==true)
							{
								lujing=@"./emotion/emotion-7.gif";
							}
							else if(biaoqing8.Checked==true)
							{
								lujing=@"./emotion/emotion-8.gif";
							}
							else if(biaoqing9.Checked==true)
							{				
								lujing=@"./emotion/emotion-9.gif";
							}
							else if(biaoqing10.Checked==true)
							{				
								lujing=@"./emotion/emotion-10.gif";
							}
							else if(biaoqing11.Checked==true)
							{				
								lujing=@"./emotion/emotion-11.gif";
							}
							else if(biaoqing12.Checked==true)
							{
								lujing=@"./emotion/emotion-12.gif";
							}
							else if(biaoqing13.Checked==true)
							{				
								lujing=@"./emotion/emotion-13.gif";
							}
							else if(biaoqing14.Checked==true)
							{				
								lujing=@"./emotion/emotion-14.gif";
							}
							string isqianming;
							if(qianming_2.Checked==true)
								isqianming="1";
							else
								isqianming="0";
							

							string ss="insert into huifu(post_id,neirong,yonghuming,lujing_pic,shijian,showqianming) values('"+int.Parse(Request.Params["post_id"].ToString())+"',@neirong,'"+Request.Cookies["free_huiyuan"].Value.ToString()+"','"+lujing+"','"+DateTime.Now.ToString()+"','"+isqianming+"')";
			        
							mycomm= new SqlCommand(ss,myconn);
							mycomm.Parameters.Add(new SqlParameter("@neirong", SqlDbType.NText));
							mycomm.Parameters["@neirong"].Value =Info.Value.ToString();
//
							try
							{
								mycomm.ExecuteNonQuery();
							}
							catch
							{}

							mycomm=new SqlCommand("update huiyuan set fatieshu=fatieshu+1,jifen=jifen+5,jinqian=jinqian+5 where yonghuming='"+Request.Cookies["free_huiyuan"].Value.ToString()+"'",myconn);
							try
							{
								mycomm.ExecuteNonQuery();
							}
							catch
							{}

							mycomm=new SqlCommand("update huiyuan set meili=meili+10 ,jifen=jifen+5,jinqian=jinqian+5 where yonghuming='"+name.Text.ToString().Trim()+"'",myconn);
							try
							{
								mycomm.ExecuteNonQuery();
							}
							catch
							{}

							Info.Value="";				
							Response.Redirect("huifu.aspx?ancestor_id="+Request.Params["ancestor_id"]+"&post_id="+int.Parse(Request.Params["post_id"].ToString())+"&Page="+nPageCount+"");
							myconn.Close();
						}
					}
					catch
					{
						myconn.Close();
					}
				}
			}
			catch
			{
				myconn.Close();
			}
		}
		private string htmlencode(string str)
		{
			str=Server.HtmlEncode(str);
			str=str.Replace("\r\n","<br>");
			char ch;
			ch=(char)32;
			str=str.Replace(ch.ToString(),"");
			return str;
		}
		private string htmldecode(string str)
		{
			
			str=Server.HtmlDecode(str);
			str=str.Replace("\r\n","<br>");
//			str=str.Replace("[img","<img  ");
//			str=str.Replace("]",">");
			
//			char ch;
//			ch=(char)32;
//			str=str.Replace(ch.ToString(),"");
			return str;
		}
	}
}

⌨️ 快捷键说明

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