我正在asp.net 2.0和c#中开发应用程序,我在服务器上上传文件,在上传文件时,我想显示进度条,显示上传完成的百分比,有人可以帮助我或建议我如何做到这一点ASP.NET 2.0
提前致谢。
Have a look at the AjaxFileUpload
control in the Asp.Net Ajax control toolkit. It supports async file uploading and will display a progress bar in browsers that supports the HTML5 File API (not IE9 unfortunately).
Anyway, instead of me repeating what's on the page, go have a look yourself.
Edit: Oops, just realized that you wrote you are using .Net 2.0. I think the Ajax control toolkit needs at least .Net 3.5 nowadays.
I think you want this kind of stuff.. if you want to add this on web site.
then you need to:
1) add reference(System.Windows.Forms) in solution
2)Then add line:
System.Windows.Forms.ProgressBar progressbar1;
progressBar1.Minimum = 0;
progressBar1.Maximum = 2000;
for (int i = 0; i < progressBar1.Maximum; i++)
{
progressBar1.Value = i;
}