C#进度条未与下载同步(WebClient类) [英] C# progress bar not synced with download (WebClient class)

查看:184
本文介绍了C#进度条未与下载同步(WebClient类)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个内部包含一个小FTP模块的系统,它根本不是主要功能,但需要......

我必须链接进度条与WebClient类事件DownloadProgressChangedEventHandler和AsyncCompletedEventHandler,进度条增量是好的,并且ASyncCompletedEventHandler启动一个MessageBox(按照预期),问题是进度条看到加载太慢......



问题:

我的MessageBox弹出100%(由事件处理程序启动),但是当MessageBox弹出我的进度条时只有+ 80%(但.VALUE实际上是100),尽管我的第一个是他们在Windows Vista中添加了一个平滑效果,这会使进度条相对于真实值变慢。



如果你们中的任何一个人遇到同样的问题,感谢你们的帮助。

对于那些谁想知道,Vista实际上为加载栏添加了平滑它看起来像Flash的补间效应。



我在Windows XP上试过,当数值达到100时,条形图达到100%。在Vista上它看起来像就像他们已经决定将装载分成延迟X.


I am coding a system which has a small FTP module included inside, it's not the main feature at all, but needed...

I must link the progressbar with the WebClient class event DownloadProgressChangedEventHandler and AsyncCompletedEventHandler, the progressbar increment is ok, and the ASyncCompletedEventHandler launch a MessageBox (as intended), the problem is that the progress bar see to load too slow...

problem :

My MessageBox pop at 100% (launched by the event handler), BUT when the MessageBox pop my progress bar is only at +-80% (but the .VALUE is really 100), the first though I had was that they have added a "smooth" effect in Windows Vista which slow down the progressbar relatively to it's true value.

If any of you have experienced the same problem thanks for your help.

解决方案

For those of you who want to know, Vista actually add a "smoothing" to the loadingbar change, it look like the "Tweening effect" of Flash.

I tried on Windows XP and the bar reach 100% exactly when the value reach 100. On Vista it look like they have decided that the "loading" would be splitted over a delay X.

这篇关于C#进度条未与下载同步(WebClient类)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆