asp.net进度条的实现(纯个人收藏)

完成上级任务写的代码,还没整理优化,仅仅做个备份,hoho,冗余度很高,效率也低,见谅见谅……
None.gif using  System;
None.gif
using  System.Collections;
None.gif
using  System.ComponentModel;
None.gif
using  System.Data;
None.gif
using  System.Drawing;
None.gif
using  System.Web;
None.gif
using  System.Web.SessionState;
None.gif
using  System.Web.UI;
None.gif
using  System.Web.UI.WebControls;
None.gif
using  System.Web.UI.HtmlControls;
None.gif
using  DataProviderCs.DataCommon;
None.gif
using  System.Text;
None.gif
using  System.Web.Mail;
None.gif
using  System.Threading;
None.gif
namespace  WebLkm.MANAGE.vipclub
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// <summary>
InBlock.gif    
/// sub_confirm 的摘要说明。
ExpandedSubBlockEnd.gif    
/// </summary>

InBlock.gif    public class sub_confirm : System.Web.UI.Page
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
protected System.Web.UI.HtmlControls.HtmlGenericControl frm;
InBlock.gif        
protected System.Web.UI.WebControls.DropDownList searchtype;
InBlock.gif        
protected System.Web.UI.WebControls.TextBox txtSj;
InBlock.gif        
protected System.Web.UI.HtmlControls.HtmlForm frmPage;
InBlock.gif        
protected System.Web.UI.HtmlControls.HtmlInputHidden subcx;
InBlock.gif        
protected System.Web.UI.WebControls.ImageButton quicksubmit;
InBlock.gif        
protected System.Web.UI.HtmlControls.HtmlGenericControl inprocess;
InBlock.gif        
protected System.Web.UI.WebControls.ImageButton release;
ContractedSubBlock.gifExpandedSubBlockStart.gif        
变量初始化#region 变量初始化
InBlock.gif        
public string mloginname = System.Configuration.ConfigurationSettings.AppSettings["mailloginname"];
InBlock.gif        
public string mloginpwd = System.Configuration.ConfigurationSettings.AppSettings["mailloginpwd"];
InBlock.gif        
public string mserver = System.Configuration.ConfigurationSettings.AppSettings["mailserver"];
InBlock.gif        
public string vtype = System.Configuration.ConfigurationSettings.AppSettings["validatetype"];
InBlock.gif        
public string from = System.Configuration.ConfigurationSettings.AppSettings["from"];
InBlock.gif        
public StringBuilder textpile=new StringBuilder(@"<table><tr><td background=../images/titlebg.gif height=32 class=t2 width=100%>&nbsp;&nbsp;发送邮件</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>");
ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif        
private void Page_Load(object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
// 在此处放置用户代码以初始化页面
InBlock.gif
            intipagetop();
InBlock.gif            
if(subcx.Value=="2")
InBlock.gif            intipagebottom();
ExpandedSubBlockEnd.gif        }

ContractedSubBlock.gifExpandedSubBlockStart.gif        
上部消息列表#region 上部消息列表
InBlock.gif        
private void intipagetop()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            StringBuilder html
=new StringBuilder();
InBlock.gif            
if(Request.QueryString["web_sub_id"]!=null)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
string[] strweb_sub_id;
InBlock.gif                
string temp=Request.QueryString["web_sub_id"].ToString();
InBlock.gif                strweb_sub_id
=temp.Split(';');
InBlock.gif            
InBlock.gif                html.Append(
@"<table class='tab_bg' width='922'  border='0' align='center' cellpadding='1' cellspacing='1'>
InBlock.gif<tr class='tab_head'>
InBlock.gif<td width=50%>标题</td>
InBlock.gif<td width=15%>发布时间</td>
InBlock.gif<td width=15%>类别</td>
InBlock.gif<td width=20%>作者</td>
InBlock.gif</tr>
InBlock.gif
");
InBlock.gif                OracleDb conn
=new OracleDb();
InBlock.gif                
for(int i=0;i<strweb_sub_id.Length;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    html.Append(gettr(conn,strweb_sub_id[i]));
ExpandedSubBlockEnd.gif                }

InBlock.gif                html.Append(
"</table>");
InBlock.gif                frm.InnerHtml
=html.ToString();
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                html.Append(
"<table class='tab_bg' width='922'  border='0' align='center' cellpadding='1' cellspacing='1'><tr align=center><td width=100%>您没有选择要发布的消息</td></tr></table>");
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        
private string gettr(OracleDb conn,string web_sub_id)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if(web_sub_id!="")
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
string strSql="select to_char(ws.PROMULGATE_DATE,'yyyy-mm-dd') PROMULGATE_DATE,ws.WEB_SUB_CN,decode(ws.WEB_SUB_TYPE,'1','促销信息','2','栏目订阅','3','网站消息通知',0) WEB_SUB_TYPE,ws.WRITER from web_sub ws where ws.status='0' and ws.web_sub_id='"+web_sub_id+"'";
InBlock.gif                DataTable dt
=new DataTable();
InBlock.gif                dt
=conn.GetDtRecorder(strSql);
InBlock.gif                
string temp=String.Format(@"<tr class='tab_td' onMouseOver='invertmenu()' onMouseOut='resumemenu()'><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td></tr>",dt.Rows[0]["web_sub_cn"].ToString(),dt.Rows[0]["PROMULGATE_DATE"].ToString(),dt.Rows[0]["WEB_SUB_TYPE"].ToString(),dt.Rows[0]["WRITER"].ToString());
InBlock.gif                
return temp;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return "";
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
下部会员列表#region 下部会员列表
InBlock.gif        
private void intipagebottom()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            StringBuilder html
=new StringBuilder();
InBlock.gif            OracleDb conn
=new OracleDb();
InBlock.gif            DataTable dt
=new DataTable();
InBlock.gif            dt
=conn.GetDtRecorder(getcrmsql());
InBlock.gif            conn.CloseDb();
InBlock.gif            html.Append(
@"<table  class='tab_bg' width='922'  border='0' align='center' cellpadding='1' cellspacing='1'>
InBlock.gif<tr class='tab_head'>
InBlock.gif<td width=15% align=center οnclick='selectall()'><font color=#FF0000><div id=hea style='cursor:hand;'>点击选择全部</div></font><input type=hidden id=cxs name=cxs value=1></td>
InBlock.gif<td>会员帐号</td>
InBlock.gif<td>会员卡号</td>
InBlock.gif<td>姓名</td>
InBlock.gif<td>订阅电子报</td>
InBlock.gif<td>订阅促销信息</td>
InBlock.gif<td>订阅栏目订阅</td>
InBlock.gif<td>订阅网站消息通知</td>
InBlock.gif</tr>
InBlock.gif
");
InBlock.gif            
if(dt.Rows.Count>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
for(int i=0;i<dt.Rows.Count;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    html.AppendFormat(
@"
ExpandedSubBlockStart.gifContractedSubBlock.gif<span οnclick='changecheck(
"+"\"objdot.gif{0}\""+@")'><tr class='tab_td' onMouseOver='invertmenu()' onMouseOut='resumemenu()'>
InBlock.gif<td align=center οnclick='window.event.cancelBubble=true;'><input type=checkbox name=cks id=obj{0} value={0}></td>
InBlock.gif<td align='center'>{1}</td>
InBlock.gif<td align='center'>{2}</td>
InBlock.gif<td align='center'>{3}</td>
InBlock.gif<td align='center'>{4}</td>
InBlock.gif<td align='center'>{5}</td>
InBlock.gif<td align='center'>{6}</td>
InBlock.gif<td align='center'>{7}</td>
InBlock.gif</tr>
InBlock.gif</span>
InBlock.gif
",dt.Rows[i]["crm_id"].ToString(),dt.Rows[i]["login_name"].ToString(),dt.Rows[i]["card_no"].ToString(),dt.Rows[i]["crm_cn"].ToString(),dt.Rows[i]["flag1"].ToString(),dt.Rows[i]["web_crmsub_type1"].ToString(),dt.Rows[i]["web_crmsub_type2"].ToString(),dt.Rows[i]["web_crmsub_type3"].ToString());
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                html.Append(
"暂无数据");
ExpandedSubBlockEnd.gif            }

InBlock.gif            html.Append(
@"</table>");
InBlock.gif            inprocess.InnerHtml
=html.ToString();
ExpandedSubBlockEnd.gif        }

InBlock.gif        
private string getcrmsql()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strSql="select temp.crm_id,temp.crm_cn,temp.login_name,temp.card_no,temp.flag1,temp.web_crmsub_type1,temp.web_crmsub_type2,temp.web_crmsub_type3 from (Select c.crm_id,c.crm_cn,c.login_name,ca.card_no,decode(c.flag1,'0','是','1','否','会员未选择(默认:是)') flag1,decode(wc.web_crmsub_type1,'1','是','0','否','会员未选择(默认:是)') web_crmsub_type1,decode(wc.web_crmsub_type2,'1','是','0','否','会员未选择(默认:是)') web_crmsub_type2,decode(wc.web_crmsub_type3,'1','是','0','否','会员未选择(默认:是)') web_crmsub_type3 From crm c,web_crmsub wc,card ca Where c.flag1='0' And c.crm_flag='1' And c.status='0' And wc.crm_id(+)=c.crm_id And wc.status(+)='0' And c.crm_id=ca.crm_id(+) and ca.status(+)='0') temp";
InBlock.gif            
if(searchtype.SelectedValue!="0")
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                strSql
+=" where temp."+searchtype.SelectedValue+" like '%"+txtSj.Text+"%'";
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return strSql;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
快速发布按钮#region 快速发布按钮
InBlock.gif        
private void quicksubmit_Click(object sender, System.Web.UI.ImageClickEventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if(Request.QueryString["web_sub_id"]!=null)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
ContractedSubBlock.gifExpandedSubBlockStart.gif                
进度条初始化#region 进度条初始化
InBlock.gif                Response.Write(
@"<html><head>
InBlock.gif<meta http-equiv=Content-Type content=text/html; charset=gb2312 />
InBlock.gif<title>无标题文档</title>
InBlock.gif<style type=text/css>
InBlock.gif<!--
InBlock.gif.t1 {
InBlock.gif    font-family: 
"+"\"宋体\""+@";
InBlock.gif    font-size: 14px;
InBlock.gif    font-style: normal;
InBlock.gif    line-height: normal;
InBlock.gif    font-weight: bold;
InBlock.gif    font-variant: normal;
InBlock.gif    text-transform: none;
InBlock.gif    color: #639500;
InBlock.gif    text-decoration: none;
InBlock.gif}
InBlock.gif.t2 {
InBlock.gif    font-family: 
"+"\"宋体\""+@";
InBlock.gif    font-size: 12px;
InBlock.gif    font-style: normal;
InBlock.gif    line-height: normal;
InBlock.gif    font-weight: bold;
InBlock.gif    font-variant: normal;
InBlock.gif    text-transform: none;
InBlock.gif    color: #000000;
InBlock.gif    text-decoration: none;
InBlock.gif}
InBlock.gif-->
InBlock.gif</style>
InBlock.gif</head><body style='overflow:-Scroll;overflow-y:hidden;overflow-x:hidden;'><input id=haha value=1 type=hidden>
");
InBlock.gif                Response.Write(
"<div id='mydiv' style='position:absolute;width:500;height:600;top:-100px;left:-300px;z-index:100;'><img src=../images/process_02.gif>");
InBlock.gif                Response.Write(
"</div>");
InBlock.gif                Response.Write(
"<div id='mydiv2' style='position:absolute;top:100px;left:50px;z-index:99;'><img src=../images/process_03.gif>");
InBlock.gif                Response.Write(
"</div>");
InBlock.gif                Response.Write(
"<div id='mydiv4' style='position:absolute;top:72px;left:360px;z-index:101;'>");
InBlock.gif                Response.Write(
"</div>");
InBlock.gif                Response.Write(
"<div  style='background:url(../images/process_01.gif) no-repeat;position:absolute;width=96px;height=103px;top:72px;left:240px;z-index:101;'><table width=100% height=100% border=0 cellspacing=0 cellpading=0><tr><td height=100% width=100%  valign=middle align='center'><div id='mydiv3' >12%</div></td></tr></table>");
InBlock.gif                Response.Write(
"</div>");
InBlock.gif                Response.Write(
"<script language=javascript>");
InBlock.gif                Response.Write(
@"function StartShowWait(){mydiv.style.visible='visible';mydiv2.style.visible='visible';mydiv4.style.visible='visible';} ");
InBlock.gif                Response.Write(
"StartShowWait();</script>");
InBlock.gif                Response.Write(
@"</body></html>");
InBlock.gif                Response.Flush();
ExpandedSubBlockEnd.gif                
#endregion

InBlock.gif                process(
"-70","-110","");
InBlock.gif                Thread.Sleep(
200);
ContractedSubBlock.gifExpandedSubBlockStart.gif                
初始化邮件#region 初始化邮件
InBlock.gif                
string[] strweb_sub_id;
InBlock.gif                
string temp=Request.QueryString["web_sub_id"].ToString();
InBlock.gif                strweb_sub_id
=temp.Split(';');
InBlock.gif                objMailclass maill
=new objMailclass();
InBlock.gif                maill.mail1
=new objMail[strweb_sub_id.Length];
InBlock.gif                maill.mail2
=new objMail[strweb_sub_id.Length];
InBlock.gif                maill.mail3
=new objMail[strweb_sub_id.Length];
InBlock.gif                
for(int i=0;i<strweb_sub_id.Length;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    objMail objtemp
=new objMail();
InBlock.gif                    objtemp
=getmail(strweb_sub_id[i]);
InBlock.gif                    
if(objtemp.strMailType=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        maill.mail1[maill.mail1cx]
=objtemp;
InBlock.gif                        maill.mail1cx
++;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else if(objtemp.strMailType=="2")
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        maill.mail2[maill.mail2cx]
=objtemp;
InBlock.gif                        maill.mail2cx
++;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else if(objtemp.strMailType=="3")
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        maill.mail3[maill.mail3cx]
=objtemp;
InBlock.gif                        maill.mail3cx
++;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif                
#endregion

InBlock.gif                process(
"-110","-156","");
InBlock.gif                Thread.Sleep(
200);    
InBlock.gif                
//初始化用户列表DataTable
InBlock.gif
                DataTable dt=new DataTable();
InBlock.gif                dt
=getuser();
InBlock.gif                
if(dt.Rows.Count>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
ContractedSubBlock.gifExpandedSubBlockStart.gif                    
初始化用户列表#region 初始化用户列表
InBlock.gif                    
string sentto1="";
InBlock.gif                    
string sentto2="";
InBlock.gif                    
string sentto3="";
InBlock.gif                    
for(int i=0;i<dt.Rows.Count;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
if(dt.Rows[i]["flag1"].ToString()=="0")
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            
if(dt.Rows[i]["web_crmsub_type1"].ToString()=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif{
InBlock.gif                                sentto1
=sentto1+dt.Rows[i]["email"].ToString()+";";
ExpandedSubBlockEnd.gif                            }

InBlock.gif                            
if(dt.Rows[i]["web_crmsub_type2"].ToString()=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif{
InBlock.gif                                sentto2
=sentto2+dt.Rows[i]["email"].ToString()+";";
ExpandedSubBlockEnd.gif                            }

InBlock.gif                            
if(dt.Rows[i]["web_crmsub_type3"].ToString()=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif{
InBlock.gif                                sentto3
=sentto3+dt.Rows[i]["email"].ToString()+";";
ExpandedSubBlockEnd.gif                            }

ExpandedSubBlockEnd.gif                        }

ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                    
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif                    
发送邮件#region 发送邮件
ContractedSubBlock.gifExpandedSubBlockStart.gif                    
根据邮件数量,进行百分比动态分配#region 根据邮件数量,进行百分比动态分配
InBlock.gif                    
int cx=maill.mail1cx+maill.mail2cx+maill.mail3cx;
InBlock.gif                    
int temp1;
InBlock.gif                    
if(((330*maill.mail1cx)/cx)%2>0)
InBlock.gif                        temp1
=(330*maill.mail1cx)/cx+1;
InBlock.gif                    
else
InBlock.gif                        temp1
=(330*maill.mail1cx)/cx;
InBlock.gif                    
int temp2;
InBlock.gif                    
if(((330*(maill.mail1cx+maill.mail2cx))/cx)%2>0)
InBlock.gif                        temp2
=(330*(maill.mail1cx+maill.mail2cx))/cx+1;
InBlock.gif                    
else
InBlock.gif                        temp2
=(330*(maill.mail1cx+maill.mail2cx))/cx;
InBlock.gif                    
int bx1;
InBlock.gif                    
if(maill.mail1cx!=0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
if((temp1/maill.mail1cx)%2>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx1
=temp1/maill.mail1cx+1;
ExpandedSubBlockEnd.gif                        }

InBlock.gif                        
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx1
=temp1/maill.mail1cx;
ExpandedSubBlockEnd.gif                        }

ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        bx1
=0;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
int bx2;
InBlock.gif                    
if(maill.mail2cx!=0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
if(((temp2-temp1)/maill.mail2cx)%2>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx2
=(temp2-temp1)/maill.mail2cx+1;
ExpandedSubBlockEnd.gif                        }

InBlock.gif                        
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx2
=(temp2-temp1)/maill.mail2cx;
ExpandedSubBlockEnd.gif                        }

ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        bx2
=0;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
int bx3;
InBlock.gif                    
if(maill.mail3cx!=0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
if(((330-temp2)/maill.mail3cx)%2>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx3
=(330-temp2)/maill.mail3cx+1;
ExpandedSubBlockEnd.gif                        }

InBlock.gif                        
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx3
=(330-temp2)/maill.mail3cx;
ExpandedSubBlockEnd.gif                        }

ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        bx3
=0;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                    
#endregion

InBlock.gif                    
for(int i=0;i<maill.mail1cx;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        sendmail(maill.mail1[i],sentto1);
InBlock.gif                        process(
"-"+Convert.ToString(156+bx1*i),"-"+Convert.ToString(156+bx1*(i+1)),maill.mail1[i].strSubject);
InBlock.gif                        Thread.Sleep(
2);    
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
for(int i=0;i<maill.mail2cx;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        sendmail(maill.mail2[i],sentto2);
InBlock.gif                        process(
"-"+Convert.ToString(156+bx1*maill.mail1cx+bx2*i),"-"+Convert.ToString(156+bx1*maill.mail1cx+bx2*(i+1)),maill.mail2[i].strSubject);
InBlock.gif                        Thread.Sleep(
2);    
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
for(int i=0;i<maill.mail3cx;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        sendmail(maill.mail3[i],sentto3);
InBlock.gif                        process(
"-"+Convert.ToString(156+bx1*maill.mail1cx+bx2*maill.mail2cx+bx3*i),"-"+Convert.ToString(156+bx1*maill.mail1cx+bx2*maill.mail2cx+bx3*(i+1)),maill.mail2[i].strSubject);
InBlock.gif                        Thread.Sleep(
2);    
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    textpile.Append(
"<tr><td height=30 colspan=2 align=center class=t1>发送成功!</td></tr><tr><td height=10 colspan=2 align=center class=t1></td></tr><tr><td height=40 colspan=2 align=center class=t1><img  style='cursor:hand;' οnclick='javascript:location=location.href.toString();' src=../images/returnbutton.gif width=71 height=25 />&nbsp;&nbsp;&nbsp;&nbsp;<img src=../images/closebutton.gif  style='cursor:hand;' οnclick='javascript:window.close();' width=71 height=25 /></td></tr>");
InBlock.gif                    Response.Write(
"<script language='javascript'>haha.value='0';mydiv3.innerText='100%';mydiv4.innerHTML=\""+textpile.ToString()+@"</table></td><td width=1 bgcolor=#ADDB52></td></tr></table></td></tr><tr><td height=5 background=../images/bottomline.gif></td></tr></table>"+"\";setTimeout(finish,1200); function finish(){mydiv3.innerText='100%';}</script></body></html>");
InBlock.gif                    Response.Flush();
InBlock.gif                    Response.Close();
ExpandedSubBlockEnd.gif                    
#endregion

ExpandedSubBlockEnd.gif                }

InBlock.gif                
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    Response.Write(
"<script language=javascript>alert('没有可以发送邮件的用户');location=location.href.toString();</script>");
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                Response.Write(
"<script language=javascript>alert('您还没有选择要发送的消息');location=location.href.toString();</script>");
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ContractedSubBlock.gifExpandedSubBlockStart.gif        
发送objMail类#region 发送objMail类
InBlock.gif        
private void sendmail(objMail objTemp,string sentto)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            MailMessage objMail
=new MailMessage();
InBlock.gif            objMail.Bcc
=sentto;
InBlock.gif            objMail.To
=from;
InBlock.gif            objMail.From
=from;
InBlock.gif            objMail.BodyFormat
=MailFormat.Html;
InBlock.gif            objMail.Subject
=objTemp.strSubject;
InBlock.gif            objMail.Body
=objTemp.strMail;
InBlock.gif            objMail.Fields.Add(
"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", vtype);
InBlock.gif            objMail.Fields.Add(
"http://schemas.microsoft.com/cdo/configuration/sendusername", mloginname); 
InBlock.gif            objMail.Fields.Add(
"http://schemas.microsoft.com/cdo/configuration/sendpassword", mloginpwd); 
InBlock.gif            SmtpMail.SmtpServer
=mserver;
InBlock.gif            
if(objMail.To != null && objMail.From!= null && SmtpMail.SmtpServer != null)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                SmtpMail.Send(objMail);
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                Response.Write(
"<script language=javascript>alert('邮件服务器正在维护,无法发送邮件');</script>");
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
获取订阅信息的用户列表#region 获取订阅信息的用户列表
InBlock.gif        
private DataTable getuser()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strSql=@"Select c.email,c.crm_id,c.crm_cn,c.login_name,ca.card_no,decode(c.flag1,'','1',null,'1',c.flag1) flag1,decode(wc.web_crmsub_type1,'','1',null,'1',wc.web_crmsub_type1) web_crmsub_type1,decode(wc.web_crmsub_type2,'','1',null,'1',wc.web_crmsub_type2) web_crmsub_type2,decode(wc.web_crmsub_type3,'','1',null,'1',wc.web_crmsub_type3) web_crmsub_type3 From crm c,web_crmsub wc,card ca Where c.flag1='0' And c.crm_flag='1' And c.status='0' And wc.crm_id(+)=c.crm_id And wc.status(+)='0' And c.crm_id=ca.crm_id(+) and ca.status(+)='0'";
InBlock.gif            OracleDb conn
=new OracleDb();
InBlock.gif            DataTable dt
=new DataTable();
InBlock.gif            dt
=conn.GetDtRecorder(strSql);
InBlock.gif            conn.CloseDb();
InBlock.gif            
return dt;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
根据web_sub_id获取邮件class#region 根据web_sub_id获取邮件class
InBlock.gif        
private objMail getmail(string web_sub_id)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            objMail mail
=new objMail();
InBlock.gif            
string strSql="select ws.* from web_sub ws where ws.status='0' and ws.web_sub_id='"+web_sub_id+"'";
InBlock.gif            OracleDb conn
=new OracleDb();
InBlock.gif            conn.DataReader
=conn.ExecuteReader(strSql);
InBlock.gif            
if(conn.DataReader.Read())
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                mail.strMailType
=conn.DataReader["web_sub_type"].ToString();
InBlock.gif                
string strtemp=conn.DataReader["CONTENT"].ToString();
InBlock.gif                strtemp
=strtemp.Replace("src=\"/","src=\"http://www.liquormart.cn/");
InBlock.gif                strtemp
=strtemp.Replace("HREF=\"/","HREF=\"http://www.liquormart.cn/");
InBlock.gif                mail.strMail
=strtemp;
InBlock.gif                
if(conn.DataReader["WEB_SUB_TYPE"].ToString()=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    mail.strSubject
="利客满促销信息:"+conn.DataReader["WEB_SUB_CN"].ToString();
ExpandedSubBlockEnd.gif                }

InBlock.gif                
else if(conn.DataReader["WEB_SUB_TYPE"].ToString()=="2")
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    mail.strSubject
="利客满栏目订阅:"+conn.DataReader["WEB_SUB_CN"].ToString();
ExpandedSubBlockEnd.gif                }

InBlock.gif                
else if(conn.DataReader["WEB_SUB_TYPE"].ToString()=="3")
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    mail.strSubject
="利客满消息通知:"+conn.DataReader["WEB_SUB_CN"].ToString();
ExpandedSubBlockEnd.gif                }

InBlock.gif                
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    conn.DataReader.Dispose();
InBlock.gif                    conn.CloseDb();
InBlock.gif                    Response.Write(
"<script language=javascript>alert('数据库数据出错!请记录错误信息:"+web_sub_id+"');location='../../login.aspx';</script>");
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            conn.DataReader.Dispose();
InBlock.gif            conn.CloseDb();
InBlock.gif            
return mail;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
输出进度条显示#region 输出进度条显示
InBlock.gif        
private void process(string intSProcess,string intEProcess,string text)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ContractedSubBlock.gifExpandedSubBlockStart.gif            
备份#region 备份
InBlock.gif            
InBlock.gif            
//            Response.Write("<script language=javascript>function move(){for(i="+intSProcess+";i<"+intEProcess+";i++){mydiv2.style.top=100-i*2;mydiv2.style.left=0-i;setTimeout(StartShowWait,1000);}}");
ExpandedSubBlockEnd.gif
            #endregion

InBlock.gif            
InBlock.gif            Response.Write(
"<script language=javascript>itop="+intSProcess+";ileft=mydiv2.offsetLeft;function move(){if(mydiv2.style.top!='"+intEProcess+"px'){ileft=ileft-1;itop=itop-2;mydiv2.style.top=itop-2;mydiv2.style.left=ileft-1;if(haha.value=='0'){mydiv3.innertText='100%';}else{ttt=(0-itop-70)/4.14;if(ttt>100)ttt=100;aaa=ttt.toString();if(ttt==100){mydiv3.innertText='100%';}else{mydiv3.innerText=aaa.slice(0,aaa.lastIndexOf('.'))+'%';}}setTimeout(move,10)}}");
InBlock.gif            
if(text!="")
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
string temp=text.Substring(8);
InBlock.gif                
string temp2=text.Substring(0,8);
InBlock.gif                textpile.AppendFormat(
@"<tr><td width=6% height=30 align=center><img src=../images/titlelog.gif width=10 height=10 /></td><td width=94%><span class=t1>{1} </span>  <span class=t2>{0}</span></td></tr>",temp,temp2);
InBlock.gif                Response.Write(
"mydiv4.innerHTML='<table width=563 border=0 cellspacing=0 cellpading=0>"+textpile.ToString()+"</table></td><td width=1 bgcolor=#ADDB52></td></tr></table></td></tr><tr><td height=5 background=../images/bottomline.gif></td></tr></table></table>';");
ExpandedSubBlockEnd.gif            }

InBlock.gif            Response.Write(
"move();</script>");
InBlock.gif            Response.Flush();
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
指定会员发布按钮#region 指定会员发布按钮
InBlock.gif        
private void release_Click(object sender, System.Web.UI.ImageClickEventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if(Request.QueryString["web_sub_id"]!=null)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
ContractedSubBlock.gifExpandedSubBlockStart.gif                
进度条初始化#region 进度条初始化
InBlock.gif                Response.Write(
@"<html><head>
InBlock.gif<meta http-equiv=Content-Type content=text/html; charset=gb2312 />
InBlock.gif<title>无标题文档</title>
InBlock.gif<style type=text/css>
InBlock.gif<!--
InBlock.gif.t1 {
InBlock.gif    font-family: 
"+"\"宋体\""+@";
InBlock.gif    font-size: 14px;
InBlock.gif    font-style: normal;
InBlock.gif    line-height: normal;
InBlock.gif    font-weight: bold;
InBlock.gif    font-variant: normal;
InBlock.gif    text-transform: none;
InBlock.gif    color: #639500;
InBlock.gif    text-decoration: none;
InBlock.gif}
InBlock.gif.t2 {
InBlock.gif    font-family: 
"+"\"宋体\""+@";
InBlock.gif    font-size: 12px;
InBlock.gif    font-style: normal;
InBlock.gif    line-height: normal;
InBlock.gif    font-weight: bold;
InBlock.gif    font-variant: normal;
InBlock.gif    text-transform: none;
InBlock.gif    color: #000000;
InBlock.gif    text-decoration: none;
InBlock.gif}
InBlock.gif-->
InBlock.gif</style>
InBlock.gif</head><body style='overflow:-Scroll;overflow-y:hidden;overflow-x:hidden;'><input id=haha value=1 type=hidden>
");
InBlock.gif                Response.Write(
"<div id='mydiv' style='position:absolute;width:500;height:600;top:-100px;left:-300px;z-index:100;'><img src=../images/process_02.gif>");
InBlock.gif                Response.Write(
"</div>");
InBlock.gif                Response.Write(
"<div id='mydiv2' style='position:absolute;top:100px;left:50px;z-index:99;'><img src=../images/process_03.gif>");
InBlock.gif                Response.Write(
"</div>");
InBlock.gif                Response.Write(
"<div id='mydiv4' style='position:absolute;top:72px;left:360px;z-index:101;'>");
InBlock.gif                Response.Write(
"</div>");
InBlock.gif                Response.Write(
"<div  style='background:url(../images/process_01.gif) no-repeat;position:absolute;width=96px;height=103px;top:72px;left:240px;z-index:101;'><table width=100% height=100% border=0 cellspacing=0 cellpading=0><tr><td height=100% width=100%  valign=middle align='center'><div id='mydiv3' >12%</div></td></tr></table>");
InBlock.gif                Response.Write(
"</div>");
InBlock.gif                Response.Write(
"<script language=javascript>");
InBlock.gif                Response.Write(
@"function StartShowWait(){mydiv.style.visible='visible';mydiv2.style.visible='visible';mydiv4.style.visible='visible';} ");
InBlock.gif                Response.Write(
"StartShowWait();</script>");
InBlock.gif                Response.Write(
@"</body></html>");
InBlock.gif                Response.Flush();
ExpandedSubBlockEnd.gif                
#endregion

InBlock.gif                process(
"-70","-110","");
InBlock.gif                Thread.Sleep(
200);
ContractedSubBlock.gifExpandedSubBlockStart.gif                
初始化邮件#region 初始化邮件
InBlock.gif                
string[] strweb_sub_id;
InBlock.gif                
string temp=Request.QueryString["web_sub_id"].ToString();
InBlock.gif                strweb_sub_id
=temp.Split(';');
InBlock.gif                objMailclass maill
=new objMailclass();
InBlock.gif                maill.mail1
=new objMail[strweb_sub_id.Length];
InBlock.gif                maill.mail2
=new objMail[strweb_sub_id.Length];
InBlock.gif                maill.mail3
=new objMail[strweb_sub_id.Length];
InBlock.gif                
for(int i=0;i<strweb_sub_id.Length;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    objMail objtemp
=new objMail();
InBlock.gif                    objtemp
=getmail(strweb_sub_id[i]);
InBlock.gif                    
if(objtemp.strMailType=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        maill.mail1[maill.mail1cx]
=objtemp;
InBlock.gif                        maill.mail1cx
++;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else if(objtemp.strMailType=="2")
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        maill.mail2[maill.mail2cx]
=objtemp;
InBlock.gif                        maill.mail2cx
++;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else if(objtemp.strMailType=="3")
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        maill.mail3[maill.mail3cx]
=objtemp;
InBlock.gif                        maill.mail3cx
++;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif                
#endregion

InBlock.gif                process(
"-110","-156","");
InBlock.gif                Thread.Sleep(
200);    
InBlock.gif                
//获得用户DataTable
InBlock.gif
                DataTable dt=new DataTable();
InBlock.gif                dt
=getappointuser();
InBlock.gif                
if(dt.Rows.Count>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
ContractedSubBlock.gifExpandedSubBlockStart.gif                    
初始化用户列表#region 初始化用户列表
InBlock.gif                    
string sentto1="";
InBlock.gif                    
string sentto2="";
InBlock.gif                    
string sentto3="";
InBlock.gif                    
for(int i=0;i<dt.Rows.Count;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
if(dt.Rows[i]["flag1"].ToString()=="0")
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            
if(dt.Rows[i]["web_crmsub_type1"].ToString()=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif{
InBlock.gif                                sentto1
=sentto1+dt.Rows[i]["email"].ToString()+";";
ExpandedSubBlockEnd.gif                            }

InBlock.gif                            
if(dt.Rows[i]["web_crmsub_type2"].ToString()=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif{
InBlock.gif                                sentto2
=sentto2+dt.Rows[i]["email"].ToString()+";";
ExpandedSubBlockEnd.gif                            }

InBlock.gif                            
if(dt.Rows[i]["web_crmsub_type3"].ToString()=="1")
ExpandedSubBlockStart.gifContractedSubBlock.gif                            
dot.gif{
InBlock.gif                                sentto3
=sentto3+dt.Rows[i]["email"].ToString()+";";
ExpandedSubBlockEnd.gif                            }

ExpandedSubBlockEnd.gif                        }

ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                    
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif                    
发送邮件#region 发送邮件
ContractedSubBlock.gifExpandedSubBlockStart.gif                    
根据邮件数量,进行百分比动态分配#region 根据邮件数量,进行百分比动态分配
InBlock.gif                    
int cx=maill.mail1cx+maill.mail2cx+maill.mail3cx;
InBlock.gif                    
int temp1;
InBlock.gif                    
if(((330*maill.mail1cx)/cx)%2>0)
InBlock.gif                        temp1
=(330*maill.mail1cx)/cx+1;
InBlock.gif                    
else
InBlock.gif                        temp1
=(330*maill.mail1cx)/cx;
InBlock.gif                    
int temp2;
InBlock.gif                    
if(((330*(maill.mail1cx+maill.mail2cx))/cx)%2>0)
InBlock.gif                        temp2
=(330*(maill.mail1cx+maill.mail2cx))/cx+1;
InBlock.gif                    
else
InBlock.gif                        temp2
=(330*(maill.mail1cx+maill.mail2cx))/cx;
InBlock.gif                    
int bx1;
InBlock.gif                    
if(maill.mail1cx!=0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
if((temp1/maill.mail1cx)%2>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx1
=temp1/maill.mail1cx+1;
ExpandedSubBlockEnd.gif                        }

InBlock.gif                        
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx1
=temp1/maill.mail1cx;
ExpandedSubBlockEnd.gif                        }

ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        bx1
=0;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
int bx2;
InBlock.gif                    
if(maill.mail2cx!=0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
if(((temp2-temp1)/maill.mail2cx)%2>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx2
=(temp2-temp1)/maill.mail2cx+1;
ExpandedSubBlockEnd.gif                        }

InBlock.gif                        
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx2
=(temp2-temp1)/maill.mail2cx;
ExpandedSubBlockEnd.gif                        }

ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        bx2
=0;
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
int bx3;
InBlock.gif                    
if(maill.mail3cx!=0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
if(((330-temp2)/maill.mail3cx)%2>0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx3
=(330-temp2)/maill.mail3cx+1;
ExpandedSubBlockEnd.gif                        }

InBlock.gif                        
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                        
dot.gif{
InBlock.gif                            bx3
=(330-temp2)/maill.mail3cx;
ExpandedSubBlockEnd.gif                        }

ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        bx3
=0;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                    
#endregion

InBlock.gif                    
for(int i=0;i<maill.mail1cx;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        sendmail(maill.mail1[i],sentto1);
InBlock.gif                        process(
"-"+Convert.ToString(156+bx1*i),"-"+Convert.ToString(156+bx1*(i+1)),maill.mail1[i].strSubject);
InBlock.gif                        Thread.Sleep(
2);    
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
for(int i=0;i<maill.mail2cx;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        sendmail(maill.mail2[i],sentto2);
InBlock.gif                        process(
"-"+Convert.ToString(156+bx1*maill.mail1cx+bx2*i),"-"+Convert.ToString(156+bx1*maill.mail1cx+bx2*(i+1)),maill.mail2[i].strSubject);
InBlock.gif                        Thread.Sleep(
2);    
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    
for(int i=0;i<maill.mail3cx;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        sendmail(maill.mail3[i],sentto3);
InBlock.gif                        process(
"-"+Convert.ToString(156+bx1*maill.mail1cx+bx2*maill.mail2cx+bx3*i),"-"+Convert.ToString(156+bx1*maill.mail1cx+bx2*maill.mail2cx+bx3*(i+1)),maill.mail3[i].strSubject);
InBlock.gif                        Thread.Sleep(
2);    
ExpandedSubBlockEnd.gif                    }

InBlock.gif                    textpile.Append(
"<tr><td height=30 colspan=2 align=center class=t1>发送成功!</td></tr><tr><td height=10 colspan=2 align=center class=t1></td></tr><tr><td height=40 colspan=2 align=center class=t1><img  style='cursor:hand;' οnclick='javascript:location=location.href.toString();' src=../images/returnbutton.gif width=71 height=25 />&nbsp;&nbsp;&nbsp;&nbsp;<img src=../images/closebutton.gif  style='cursor:hand;' οnclick='javascript:window.close();' width=71 height=25 /></td></tr>");
InBlock.gif                    Response.Write(
"<script language='javascript'>haha.value='0';mydiv3.innerText='100%';mydiv4.innerHTML=\""+textpile.ToString()+@"</table></td><td width=1 bgcolor=#ADDB52></td></tr></table></td></tr><tr><td height=5 background=../images/bottomline.gif></td></tr></table>"+"\";setTimeout(finish,1200); function finish(){mydiv3.innerText='100%';}</script></body></html>");
InBlock.gif                    Response.Flush();
InBlock.gif                    Response.Close();
ExpandedSubBlockEnd.gif                    
#endregion

ExpandedSubBlockEnd.gif                }

InBlock.gif                
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    Response.Write(
"<script language=javascript>alert('没有可以发送邮件的用户');location=location.href.toString();</script>");
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                Response.Write(
"<script language=javascript>alert('您还没有选择要发送的消息');location=location.href.toString();</script>");
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
获取指定用户的用户列表#region 获取指定用户的用户列表
InBlock.gif        
private DataTable getappointuser()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            OracleDb conn
=new OracleDb();
InBlock.gif            DataTable dt
=new DataTable();
InBlock.gif            dt.Columns.Add(
"email");
InBlock.gif            dt.Columns.Add(
"crm_id");
InBlock.gif            dt.Columns.Add(
"crm_cn");
InBlock.gif            dt.Columns.Add(
"login_name");
InBlock.gif            dt.Columns.Add(
"card_no");
InBlock.gif            dt.Columns.Add(
"flag1");
InBlock.gif            dt.Columns.Add(
"web_crmsub_type1");
InBlock.gif            dt.Columns.Add(
"web_crmsub_type2");
InBlock.gif            dt.Columns.Add(
"web_crmsub_type3");
InBlock.gif            
string[] temp=Request.Form["cks"].ToString().Split(',');
InBlock.gif            
for(int i=0;i<temp.Length;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataRow dr
=dt.NewRow();
InBlock.gif                
string strSql=@"Select c.email,c.crm_id,c.crm_cn,c.login_name,ca.card_no,decode(c.flag1,'','1',null,'1',c.flag1) flag1,decode(wc.web_crmsub_type1,'','1',null,'1',wc.web_crmsub_type1) web_crmsub_type1,decode(wc.web_crmsub_type2,'','1',null,'1',wc.web_crmsub_type2) web_crmsub_type2,decode(wc.web_crmsub_type3,'','1',null,'1',wc.web_crmsub_type3) web_crmsub_type3 From crm c,web_crmsub wc,card ca Where c.flag1='0' And c.crm_flag='1' And c.status='0' And wc.crm_id(+)=c.crm_id And wc.status(+)='0' And c.crm_id=ca.crm_id(+) and ca.status(+)='0' and c.crm_id='"+temp[i]+"'";
InBlock.gif                conn.DataReader
=conn.ExecuteReader(strSql);
InBlock.gif                
if(conn.DataReader.Read())
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    dr[
"email"]=conn.DataReader["email"].ToString();
InBlock.gif                    dr[
"crm_id"]=conn.DataReader["crm_id"].ToString();
InBlock.gif                    dr[
"crm_cn"]=conn.DataReader["crm_cn"].ToString();
InBlock.gif                    dr[
"login_name"]=conn.DataReader["login_name"].ToString();
InBlock.gif                    dr[
"card_no"]=conn.DataReader["card_no"].ToString();
InBlock.gif                    dr[
"flag1"]=conn.DataReader["flag1"].ToString();
InBlock.gif                    dr[
"web_crmsub_type1"]=conn.DataReader["web_crmsub_type1"].ToString();
InBlock.gif                    dr[
"web_crmsub_type2"]=conn.DataReader["web_crmsub_type2"].ToString();
InBlock.gif                    dr[
"web_crmsub_type3"]=conn.DataReader["web_crmsub_type3"].ToString();
InBlock.gif                    dt.Rows.Add(dr);
ExpandedSubBlockEnd.gif                }

InBlock.gif                conn.DataReader.Dispose();
ExpandedSubBlockEnd.gif            }

InBlock.gif            
//            string strSql=@"Select c.email,c.crm_id,c.crm_cn,c.login_name,ca.card_no,decode(c.flag1,'8','是','1') flag1,decode(wc.web_crmsub_type1,'8','是','1') web_crmsub_type1,decode(wc.web_crmsub_type2,'8','是','1') web_crmsub_type2,decode(wc.web_crmsub_type3,'8','是','1') web_crmsub_type3 From crm c,web_crmsub wc,card ca Where c.flag1='0' And c.crm_flag='1' And c.status='0' And wc.crm_id(+)=c.crm_id And wc.status(+)='0' And c.crm_id=ca.crm_id(+) and ca.status(+)='0'";
InBlock.gif            
InBlock.gif            
//            dt=conn.GetDtRecorder(strSql);
InBlock.gif
            conn.CloseDb();
InBlock.gif            
return dt;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
邮件结构类#region 邮件结构类
InBlock.gif        
public class objMail
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//        public void add(objMail mail)
InBlock.gif            
//        {
InBlock.gif            
//            strMail+=mail.strMail;
InBlock.gif            
//            strSubject+=mail.strSubject;
InBlock.gif            
//        }
InBlock.gif
            public string strMail;
InBlock.gif            
public string strSubject;
InBlock.gif            
public string strMailType;
ExpandedSubBlockEnd.gif        }

InBlock.gif        
public class objMailclass
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
public objMail[] mail1;
InBlock.gif            
public int mail1cx=0;
InBlock.gif            
public objMail[] mail2;
InBlock.gif            
public int mail2cx=0;
InBlock.gif            
public objMail[] mail3;
InBlock.gif            
public int mail3cx=0;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

ContractedSubBlock.gifExpandedSubBlockStart.gif        
Web 窗体设计器生成的代码#region Web 窗体设计器生成的代码
InBlock.gif        
override protected void OnInit(EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//
InBlock.gif            
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
InBlock.gif            
//
InBlock.gif
            InitializeComponent();
InBlock.gif            
base.OnInit(e);
ExpandedSubBlockEnd.gif        }

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
InBlock.gif        
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
InBlock.gif        
/// 此方法的内容。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void InitializeComponent()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            
this.release.Click += new System.Web.UI.ImageClickEventHandler(this.release_Click);
InBlock.gif            
this.quicksubmit.Click += new System.Web.UI.ImageClickEventHandler(this.quicksubmit_Click);
InBlock.gif            
this.Load += new System.EventHandler(this.Page_Load);
InBlock.gif
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

简化后的页面及demo,见页面 http://www.cnblogs.com/suntears/archive/2007/04/24/724833.html

转载于:https://www.cnblogs.com/suntears/archive/2007/04/23/724181.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值