进度条

 protected void processBar(int c, int t)
    {
        if (c == 0)
        {
            string strFileName = Request.PhysicalApplicationPath + "//admin//progressbar.htm";
            System.IO.StreamReader sr = new System.IO.StreamReader(strFileName, System.Text.Encoding.Default);
            string strHtml = sr.ReadToEnd();

            Response.Write(strHtml);
            sr.Close();
            Response.Flush();
        }
        Response.Write("<script>setPgb('pgbMain'," + ((c + 1) * 100) / t + ");</script>");
        Response.Flush();
    }

//使用

   processBar(i, TopicList.Rows.Count);

progressbar.htm

<script language="javascript">
function setPgb(pgbID, pgbValue)

     if ( pgbValue <= 100 )
     {
         if (lblObj = document.getElementById(pgbID + "_label"))

         {
              lblObj.innerHTML = pgbValue + "%"; // change the label value
         }
         if ( pgbObj = document.getElementById(pgbID) )

         {
             var divChild = pgbObj.children[0];
              pgbObj.children[0].style.width = pgbValue + "%";
         }
     }                                        
}
</script>

<html>
<head>
<style type="text/css">
    .bi-loading-status {
    width:   100%
    padding: 1px;
    overflow: hidden;
    }
    .bi-loading-status .text {
    white-space:  nowrap;
    overflow:     hidden;
    width:             10%;
    text-overflow:     ellipsis;
    padding:      1px;
    float: right;
    }

    .bi-loading-status .progress-bar {
    border:       1px solid ThreeDShadow;
    background:   window;
    height:       16px;
    width:        88%;
    padding: 1px;
    overflow: hidden;
    float: left;
    }

    .bi-loading-status .progress-bar div {
    background:   Highlight;
    overflow: hidden;
    height:       100%;
    filter:       Alpha(Opacity=0, FinishOpacity=100, Style=1, StartX=0, StartY=0, FinishX=100, FinishY=0);
    }
</style>

</head>
<body topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0">
    <table border="0" align="center" width="70%"><tr><td>   
       <DIV class="bi-loading-status" id="proBar" style="width: 100%;">
            <DIV class="text" id="pgbMain_label" align="left"></DIV>
            <DIV class="progress-bar" id="pgbMain" align="left">
                 <DIV STYLE="WIDTH:10%"></DIV>
            </DIV>
       </DIV>
    </td></tr></table>
</body>
</html>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值