Progress bar

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Daniil
Posts: 2
Last visit: Sat Jul 08, 2017 2:58 am

Progress bar

Post by Daniil »

Hello guys!
So, I have a script which shows Download Progress from FTP.
I just try many ways to solve this task.
One of the conclusions was that cmdlet Register-ObjectEvent is a really bad idea.. Async eventing is rather poorly supported in Powershell...
And I stopped there -
$webclient.add_DownloadProgressChanged([System.Net.DownloadProgressChangedEventHandler]$webclient_DownloadProgressChanged )
....
$webclient_DownloadProgressChanged = {
param([System.Net.DownloadProgressChangedEventArgs]$Global:e)
$progressbaroverlay1.value=$e.ProgressPercentage
....
}

And everything in this sript works fine, but you can understand that I did this was for a one file.
But then I started thinking - How I can download several files at the same time and show it in a one progress bar?
So anyone have any great ideas? Or best way to solve this task?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress bar

Post by jvierra »

WebClient can only download one file at a time.
User avatar
Daniil
Posts: 2
Last visit: Sat Jul 08, 2017 2:58 am

Re: Progress bar

Post by Daniil »

jvierra wrote:WebClient can only download one file at a time.
Of course, I know it. But maybe, can I create multiple webclients to obtain TotalProgressPercentage?
Maybe you know how to do it?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Progress bar

Post by jvierra »

No. That doesn't make much sense to me.
This topic is 6 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked