<%@ Page language="c#" Inherits="BookShop.Myshow" CodeFile="Myshow.aspx.cs" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML> <HEAD> <title>Myshow</title> </HEAD> <body leftmargin="0" topmargin="0"> <form id="Form1" method="post" runat="server"> <table height="336"> <tr> <td valign="top"> <DIV id="bodyshow" style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; BORDER-LEFT: #000000 1px solid; WIDTH: 140px; PADDING-TOP: 0px; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 226px" runat="server"><FONT face="宋体"></FONT></DIV> <FONT face="宋体"> <asp:ImageButton id="btnSave" runat="server" ImageUrl="equipment/save.gif" OnClick="btnSave_Click1"></asp:ImageButton> <asp:ImageButton id="ImageButton2" runat="server" ImageUrl="equipment/restatus.gif" OnClick="ImageButton2_Click"></asp:ImageButton></FONT> </td> <td> <TABLE id="Table1" height="336" cellSpacing="0" cellPadding="0" width="328" border="0"> <TR> <TD width="41"> <asp:ImageButton id="btn4_1" runat="server" ImageUrl="equipment/4/1x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="71"><FONT face="宋体"></FONT> <asp:ImageButton id="btn4_2" runat="server" ImageUrl="equipment/4/2x.gif"></asp:ImageButton><A href="#"></A></TD> <TD> <asp:ImageButton id="btn4_3" runat="server" ImageUrl="equipment/4/3x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="390"> <asp:ImageButton id="btn4_4" runat="server" ImageUrl="equipment/4/4x.gif"></asp:ImageButton><A href="#"></A></TD> </TR> <TR> <TD width="41"><FONT face="宋体"></FONT><FONT face="宋体"></FONT> <asp:ImageButton id="btn3_1" runat="server" ImageUrl="equipment/3/1x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="71"><FONT face="宋体"></FONT> <asp:ImageButton id="btn3_2" runat="server" ImageUrl="equipment/3/2x.gif"></asp:ImageButton><A href="#"></A></TD> <TD><FONT face="宋体"></FONT> <asp:ImageButton id="btn3_3" runat="server" ImageUrl="equipment/3/3x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="390"><FONT face="宋体"></FONT> <asp:ImageButton id="btn3_4" runat="server" ImageUrl="equipment/3/4x.gif"></asp:ImageButton><A href="#"></A></TD> </TR> <TR> <TD width="41"><FONT face="宋体"></FONT> <asp:ImageButton id="btn2_1" runat="server" ImageUrl="equipment/2/1x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="71"><FONT face="宋体"></FONT> <asp:ImageButton id="btn2_2" runat="server" ImageUrl="equipment/2/2x.gif"></asp:ImageButton><A href="#"></A></TD> <TD><FONT face="宋体"></FONT> <asp:ImageButton id="btn2_3" runat="server" ImageUrl="equipment/2/3x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="390"><FONT face="宋体"></FONT> <asp:ImageButton id="btn2_4" runat="server" ImageUrl="equipment/2/4x.gif"></asp:ImageButton><A href="#"></A></TD> </TR> <TR> <TD width="41"><FONT face="宋体"></FONT><FONT face="宋体"></FONT> <asp:ImageButton id="btn1_1" runat="server" ImageUrl="equipment/1/1x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="71"><FONT face="宋体"></FONT><FONT face="宋体"></FONT> <asp:ImageButton id="btn1_2" runat="server" ImageUrl="equipment/1/2x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="13%"><FONT face="宋体"></FONT><FONT face="宋体"></FONT> <asp:ImageButton id="btn1_3" runat="server" ImageUrl="equipment/1/3x.gif"></asp:ImageButton><A href="#"></A></TD> <TD width="390"><FONT face="宋体"></FONT> <asp:ImageButton id="btn1_4" runat="server" ImageUrl="equipment/1/4x.gif"></asp:ImageButton><A href="#"></A></TD> </TR> </TABLE> </td> </tr> </table> <asp:Label id="Label1" runat="server">df>df>df>0</asp:Label> </form> </body></HTML>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;
namespace BookShop{ /// <summary> /// Myshow 的摘要说明。 /// </summary> public partial class Myshow : System.Web.UI.Page { private string Newequip;//新的QQ秀//用于保存设置后的QQ秀
protected void Page_Load(object sender, System.EventArgs e) { if(!this.IsPostBack) {
} }
#region Web 窗体设计器生成的代码 override protected void OnInit(EventArgs e) { // // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。 // InitializeComponent(); base.OnInit(e); } /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.btnSave.Click += new System.Web.UI.ImageClickEventHandler(this.btnSave_Click); this.btn4_1.Click += new System.Web.UI.ImageClickEventHandler(this.btn4_1_Click); this.btn4_2.Click += new System.Web.UI.ImageClickEventHandler(this.btn4_2_Click); this.btn4_3.Click += new System.Web.UI.ImageClickEventHandler(this.btn4_3_Click); this.btn4_4.Click += new System.Web.UI.ImageClickEventHandler(this.btn4_4_Click); this.btn3_1.Click += new System.Web.UI.ImageClickEventHandler(this.btn3_1_Click); this.btn3_2.Click += new System.Web.UI.ImageClickEventHandler(this.btn3_2_Click); this.btn3_3.Click += new System.Web.UI.ImageClickEventHandler(this.btn3_3_Click); this.btn3_4.Click += new System.Web.UI.ImageClickEventHandler(this.btn3_4_Click); this.btn2_1.Click += new System.Web.UI.ImageClickEventHandler(this.btn2_1_Click); this.btn2_2.Click += new System.Web.UI.ImageClickEventHandler(this.btn2_2_Click); this.btn2_3.Click += new System.Web.UI.ImageClickEventHandler(this.btn2_3_Click); this.btn2_4.Click += new System.Web.UI.ImageClickEventHandler(this.btn2_4_Click); this.btn1_1.Click += new System.Web.UI.ImageClickEventHandler(this.btn1_1_Click); this.btn1_2.Click += new System.Web.UI.ImageClickEventHandler(this.btn1_2_Click); this.btn1_3.Click += new System.Web.UI.ImageClickEventHandler(this.btn1_3_Click); this.btn1_4.Click += new System.Web.UI.ImageClickEventHandler(this.btn1_4_Click);
} #endregion /// <summary> /// 这个函数由配置码为参数,显示虚拟形象 /// </summary> /// <param name="equip">配置码</param> /// <returns>div的innerhtml字符串</returns> public void Shoiwit(string equip) { string[] showlayers=equip.Split(new Char [] {'>'});//定义一个数组,数组中的每个元素保存每一层的图片代码值 string str="";//定义一个字符串,用于保存div的innerhtml值。 for(int i=0;i<showlayers.Length;i++) { //如果图片名为0或空值则该层不显示 if(!showlayers[i].Equals("0")&&!showlayers[i].Equals("")) { str+="<img src='equipment/"+(i+1)+"/"+showlayers[i]+".gif'"+ " style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:"+(i+1)+";'>"; } } //最后在最上一层覆盖一幅完全透明的图片,这样用户在上面右链>另存为也只能保存这幅图了: str+="<img src='equipment/blank.gif'"+ " style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:100;'>"; this.Label1.Text=equip; this.bodyshow.InnerHtml=str; } /// <summary> ///这个函数用于更换配置 /// </summary> /// <param name="layer">更换第几层</param> /// <param name="img">图片名</param> public void dressit(int layer,string img) { string myequip=this.Label1.Text;//保存设置的QQ秀 string[] showlayers=myequip.Split(new Char [] {'>'});//定义一个数组,数组中的每个元素保存每一层的图片代码值 for(int i=0;i<showlayers.Length;i++) { if(i+1==layer) { if(img!=showlayers[i]) this.Newequip+=img; else this.Newequip+="df"; } else { this.Newequip+=showlayers[i];//其他层图片不变 } if(i+1!=showlayers.Length) this.Newequip+=">"; } this.Shoiwit(this.Newequip); } private void btn4_1_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(4,"1"); }
private void btn4_2_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(4,"2"); }
private void btn4_3_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(4,"3"); }
private void btn4_4_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(4,"4"); }
private void btn3_1_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(3,"1"); }
private void btn3_2_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(3,"2"); }
private void btn3_3_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(3,"3"); }
private void btn3_4_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(3,"4"); }
private void btn2_1_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(2,"1"); }
private void btn2_2_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(2,"2"); }
private void btn2_3_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(2,"3"); }
private void btn2_4_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(2,"4"); }
private void btn1_1_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(1,"1"); }
private void btn1_2_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(1,"2"); }
private void btn1_3_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(1,"3"); }
private void btn1_4_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.dressit(1,"4"); }
private void btnSave_Click(object sender, System.Web.UI.ImageClickEventArgs e) { Response.Write("<script>alert('"+this.Newequip+"')</script>"); }
protected void btnSave_Click1(object sender, ImageClickEventArgs e) {
} protected void ImageButton2_Click(object sender, ImageClickEventArgs e) {
}}}