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.SqlClient;

namespace free.bbs
{
	/// <summary>
	/// Summary description for chakanxiaoxi.
	/// </summary>
	public class chakanxiaoxi : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Literal zhuti;
		protected System.Web.UI.WebControls.TextBox neirong;
		protected System.Web.UI.WebControls.Literal fasongzhe;
		SqlConnection monn;
		SqlCommand cmd;
		SqlDataReader read;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
		
//			try
//			{
				string id=Request.Params["id"].ToString();
				monn=new SqlConnection(Session["str_connection"].ToString());
				string sql="select faqiren,zhuti,neirong from duanxiaoxi where xiaoxi_id='"+id+"'";
				monn.Open();
				cmd=new SqlCommand(sql,monn);
//				try
//				{
					read=cmd.ExecuteReader();
					read.Read();
					fasongzhe.Text=read.GetString(0).ToString().Trim();
					Session["post"]=fasongzhe.Text;
					zhuti.Text=read.GetString(1).ToString().Trim();
					neirong.Text=read["neirong"].ToString();
					read.Close();
					cmd=new SqlCommand(" update duanxiaoxi set islook='1' where xiaoxi_id="+Request.Params["id"]+"" ,monn);
					cmd.ExecuteReader();
					monn.Close();
//				}
//				catch
//				{}
//			}
//			catch
//			{}
		}

		#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.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion
	}
}
