上一篇只是备份了下代码,这次是可以独立运行的demo。
demo模拟的是发送多封邮件过程中进度条的显示。其中图片设计的不太规范,所以js控制进度条移动的代码有点乱,这个大家可以替换成自己的,这里只是演示作用。
进度条动态增长的原理是:一个中间扣空的酒瓶子图片,这个图片下面放另外一张图片,移动下层图片以实现进度条增长效果。
demo模拟的是发送多封邮件过程中进度条的显示。其中图片设计的不太规范,所以js控制进度条移动的代码有点乱,这个大家可以替换成自己的,这里只是演示作用。
进度条动态增长的原理是:一个中间扣空的酒瓶子图片,这个图片下面放另外一张图片,移动下层图片以实现进度条增长效果。
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.Text;
using System.Threading;
namespace guagedemo
{
/// <summary>
/// guagedemo 的摘要说明。
/// </summary>
public class guagedemo : System.Web.UI.Page
{
public StringBuilder textpile=new StringBuilder(@"<table><tr><td background=images/titlebg.gif height=32 class=t2 width=100%> 发送邮件</td></tr><tr><td><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td width=1 bgcolor=#ADDB52></td><td width=561 valign=top><table width=100% border=0 cellspacing=0 cellpadding=0 background=images/tablebg.gif><tr><td height=6 colspan=2></td></tr>");
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
objMailclass mail=new objMailclass();
mail.mail1=new objMail[3];
mail.mail1cx=3;
mail.mail2=new objMail[3];
mail.mail2cx=3;
mail.mail3=new objMail[3];
mail.mail3cx=3;
mail.mail1[0]=new objMail();
mail.mail1[0].strSubject="类别1邮件:邮件1";
mail.mail1[1]=new objMail();
mail.mail1[1].strSubject="类别1邮件:邮件2";
mail.mail1[2]=new objMail();
mail.mail1[2].strSubject="类别1邮件:邮件3";
mail.mail2[0]=new objMail();
mail.mail2[0].strSubject="类别2邮件:邮件1";
mail.mail2[1]=new objMail();
mail.mail2[1].strSubject="类别2邮件:邮件2";
mail.mail2[2]=new objMail();
mail.mail2[2].strSubject="类别2邮件:邮件3";
mail.mail3[0]=new objMail();
mail.mail3[0].strSubject="类别3邮件:邮件1";
mail.mail3[1]=new objMail();
mail.mail3[1].strSubject="类别3邮件:邮件2";
mail.mail3[2]=new objMail();
mail.mail3[2].strSubject="类别3邮件:邮件3";
intipagetop(mail);
}
输出进度条显示
private void intipagetop(objMailclass maill)
{
进度条初始化
process("-70","-110","");
Thread.Sleep(200);
process("-110","-156","");
Thread.Sleep(200);
发送邮件
}
public class objMail
{
public string strMail;
public string strSubject;
public string strMailType;
}
public class objMailclass
{
public objMail[] mail1;
public int mail1cx=0;
public objMail[] mail2;
public int mail2cx=0;
public objMail[] mail3;
public int mail3cx=0;
}
Web 窗体设计器生成的代码
}
}
demo下载
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.Text;
using System.Threading;
namespace guagedemo
{
/// <summary>
/// guagedemo 的摘要说明。
/// </summary>
public class guagedemo : System.Web.UI.Page
{
public StringBuilder textpile=new StringBuilder(@"<table><tr><td background=images/titlebg.gif height=32 class=t2 width=100%> 发送邮件</td></tr><tr><td><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td width=1 bgcolor=#ADDB52></td><td width=561 valign=top><table width=100% border=0 cellspacing=0 cellpadding=0 background=images/tablebg.gif><tr><td height=6 colspan=2></td></tr>");
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
objMailclass mail=new objMailclass();
mail.mail1=new objMail[3];
mail.mail1cx=3;
mail.mail2=new objMail[3];
mail.mail2cx=3;
mail.mail3=new objMail[3];
mail.mail3cx=3;
mail.mail1[0]=new objMail();
mail.mail1[0].strSubject="类别1邮件:邮件1";
mail.mail1[1]=new objMail();
mail.mail1[1].strSubject="类别1邮件:邮件2";
mail.mail1[2]=new objMail();
mail.mail1[2].strSubject="类别1邮件:邮件3";
mail.mail2[0]=new objMail();
mail.mail2[0].strSubject="类别2邮件:邮件1";
mail.mail2[1]=new objMail();
mail.mail2[1].strSubject="类别2邮件:邮件2";
mail.mail2[2]=new objMail();
mail.mail2[2].strSubject="类别2邮件:邮件3";
mail.mail3[0]=new objMail();
mail.mail3[0].strSubject="类别3邮件:邮件1";
mail.mail3[1]=new objMail();
mail.mail3[1].strSubject="类别3邮件:邮件2";
mail.mail3[2]=new objMail();
mail.mail3[2].strSubject="类别3邮件:邮件3";
intipagetop(mail);
}
输出进度条显示
private void intipagetop(objMailclass maill)
{
进度条初始化
process("-70","-110","");
Thread.Sleep(200);
process("-110","-156","");
Thread.Sleep(200);
发送邮件
}
public class objMail
{
public string strMail;
public string strSubject;
public string strMailType;
}
public class objMailclass
{
public objMail[] mail1;
public int mail1cx=0;
public objMail[] mail2;
public int mail2cx=0;
public objMail[] mail3;
public int mail3cx=0;
}
Web 窗体设计器生成的代码
}
}