如何显示进度条?[英] How to show progress bar?

本文是小编为大家收集整理的关于如何显示进度条?的处理方法,想解了如何显示进度条?的问题怎么解决?如何显示进度条?问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

你好,

服务器端有一个长时间运行的方法.如何显示进度条,例如完成 5%、10%……等直到完成 100%?

请指导我.谢谢.

推荐答案

你好,

请参考下面的文章,我认为您不需要再阅读文章了.本文介绍了使用vb代码的功能,但您可以理解它.

ProgressBar for ASP.NET[^]

希望对你有帮助,
谢谢
-Amit Gajjar

查看此链接,
http://www.dreamincode.net/forums/topic/62979-add-the-percent-into-a-progress-bar/[^]


请按照我的代码供您参考...

pbUpload.Minimum = 0;pbUpload.Maximum = 100;pbUpload.ShowPosition = true;

Int32 Val1 =((Int32)DateTime.Parse(Session["timeout"].ToString()).Subtract(DateTime.Now).TotalMinutes);
if (Val1.Equals(9)){pbUpload.IndicatorStyle.BackColor = System.Drawing.Color.Red;}else if(Val1.Equals(8)){int count = Convert.ToInt16(pbUpload.Value);for (count = 0; count <= 10; count++){pbUpload.Value = count + 1;}pbUpload.IndicatorStyle.BackColor = System.Drawing.Color.Peru;}else if (Val1.Equals(7)){int count = Convert.ToInt16(pbUpload.Value);for (count = 0; count <= 30;count++){pbUpload.Value = count + 1;}pbUpload.IndicatorStyle.BackColor = System.Drawing.Color.Salmon;}else if (Val1.Equals(6)){int count = Convert.ToInt16(pbUpload.Value);for (count = 0; count <= 50;count++){pbUpload.Value = count + 1;}pbUpload.IndicatorStyle.BackColor = System.Drawing.Color.Navy;}else if (Val1.Equals(4)){pbUpload.IndicatorStyle.BackColor = System.Drawing.Color.Red;}else if (Val1.Equals(3)){pbUpload.IndicatorStyle.BackColor = System.Drawing.Color.Peru;}else if (Val1.Equals(2)){pbUpload.IndicatorStyle.BackColor = System.Drawing.Color.Salmon;}else if (Val1.Equals(1)){pbUpload.IndicatorStyle.BackColor = System.Drawing.Color.Navy;}

本文地址:https://www.itbaoku.cn/post/1356064.html