📄 showvideo.aspx.cs
字号:
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 gllbysj
{
/// <summary>
/// ShowVideo 的摘要说明。
/// </summary>
public class ShowVideo : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label6;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.Label Label7;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.Label Label8;
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.Image Image1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
this.con();
}
public void con()
{
string id=Request.QueryString["moveid"].ToString();
SqlConnection con=db.createcon();
con.Open ();
SqlCommand cmm=new SqlCommand("select * from mess where id='"+id+"'",con);
SqlDataReader dr=cmm.ExecuteReader();
if(dr.Read())
{
this.Label6.Text=dr["name"].ToString();
this.Label1.Text=dr["class1"].ToString();
this.Label2.Text=dr["sizev"].ToString();
this.Label3.Text=dr["times"].ToString();
this.Label4.Text=dr["hits"].ToString();
string str=dr["descr"].ToString();
str=str.Substring(0)+"......";
this.Label5.Text="  "+str;
this.Label7.Text=dr["主要演员"].ToString();
this.Image1.ImageUrl="upimage/"+dr["image"].ToString();
this.Label8.Text="["+dr["talk"].ToString()+"]";
//string str2=dr["filename"].ToString();
//string id1=dr["id"].ToString();
Session["playid"]=dr["id"].ToString();
Session["hit"]=dr["hits"].ToString();
Session["vname"]=dr["name"].ToString();
Session["vid"]=dr["id"].ToString();
}
con.Close();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void LinkButton1_Click(object sender, System.EventArgs e)
{
SqlConnection conn=db.createcon();
conn.Open();
int a=Convert.ToInt32(Convert.ToString(Session["hit"].ToString()));
a++;
int s=Convert.ToInt32(Convert.ToString(Session["playid"].ToString()));
//int ss=Convert.ToInt32(s);
SqlCommand cmm=new SqlCommand("update mess set hits='"+a+"' where id='"+s+"'",conn);
cmm.ExecuteNonQuery();
conn.Close();
Response.Redirect("play.aspx");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -