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;
namespace baoge
{
	/// <summary>
	/// lookmovie 的摘要说明。
	/// </summary>
	public class lookmovie : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.Label Label2;
		
		private void Page_Load(object sender, System.EventArgs e)
		{
			if(Session["flag"]==null||Session["flag"].ToString()=="false")
			{
				Response.Redirect("login.aspx");
			}
			if(!this.IsPostBack)
			{
				string movieid=Server.UrlDecode(Request.QueryString["movieid"].ToString());
				string moviename=Server.UrlDecode(Request.QueryString["moviename"].ToString());
				string look=Server.UrlDecode(Request.QueryString["look"].ToString());
				string dbPath=System.Configuration.ConfigurationSettings.AppSettings["dbPath"];
				//定义连接字符串
				string ACconnStr="Provider=Microsoft.Jet.OleDb.4.0;Data Source="+Server.MapPath(dbPath);
				//创建数据库对像
				OleDbConnection ACconn=new OleDbConnection(ACconnStr);


				ACconn.Open();

				//定义SQL语句
				string ACsql="select * from movie where Movie_ID="+movieid;

				//创建Command对像
				OleDbCommand ACcomm=new OleDbCommand(ACsql,ACconn);
				//通过执行Command实例化DataReader类
				OleDbDataReader ACdr=ACcomm.ExecuteReader();
				if(ACdr.Read ())
				{
					this.Label1.Text="<embed src='"+look+"' target=_blank width=422 height=320></embed>";
					this.Label2.Text="【"+moviename+"】";
				}
				ACdr.Close ();//切记一定要关闭阅读器

			
				ACconn.Close();
			}
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion
	}
}
