zachary1337 Posted October 8, 2014 Report Posted October 8, 2014 Cum fac sa imi afiseze in progressbar cat la % sa descarcat un fisier de pe net? aici e codu meuMy.Computer.Network.DownloadFile("path", System.IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Desktop, "name.file"))am cautat pe net cateva exemple dar nu am reusit.. Quote
Byte-ul Posted October 8, 2014 Report Posted October 8, 2014 Download File Asynchronously With ProgressBar - VB.NET Tutorials | Dream.In.Code Quote
zachary1337 Posted October 8, 2014 Author Report Posted October 8, 2014 Download File Asynchronously With ProgressBar - VB.NET Tutorials | Dream.In.Codela fel nimic.. Quote
nedo Posted October 8, 2014 Report Posted October 8, 2014 In mod normal, cand descarci un fisier de pe o pagina net spre exemplu, serverul iti trimite marimea fisierului.O iei din headere. De acolo doar calculezi procentul descarcat.Formula ar fi:(biti descarcati * total biti)/ 100;si pui progres bar-ul la valoarea respectiva(eventual rotunjesti sa fie valoare intreaga). Quote
daatdraqq Posted October 8, 2014 Report Posted October 8, 2014 (edited) Form11 buton numit : Button12 timer numite : Timer1 (interval 500), Timer2 (interval 100)1 progressbar numit : ProgressBar1In loc de "C:\Users\Admin\Desktop\eu.exe" pui locatia din pc-ul tau unde vrei sa-ti descarce .Dublu clik pe Form1 ,sterge codul si adauga :Imports System.NetPublic Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ProgressBar1.Increment(10) If ProgressBar1.Value = 50 Then Timer2.Start() End If If ProgressBar1.Value = 100 Then Me.Close() End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim client As New System.Net.WebClient Dim adresa_fisier As String = "http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe" client.DownloadFile(adresa_fisier, "C:\Users\Admin\Desktop\eu.exe") End SubEnd Class Edited October 8, 2014 by daatdraqq Quote
Byte-ul Posted October 8, 2014 Report Posted October 8, 2014 la fel nimic..Cum adica nimic? Nu stii sa implementezi sau ce are? Quote