Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Help] Codes for Downloading Progress[Solved]

[Help] Codes for Downloading Progress[Solved]

Posts 1–6 of 6 · Page 1 of 1
karldeovbnet
karldeovbnet
[Help] Codes for Downloading Progress[Solved]
im using this codes to download:

Code:
My.Computer.Network.DownloadFile(TextBox4.Text, "C:\updateproject.exe")
i need codes showing the progress of the downloaded file,

advance thanks everyone.
#1 · 15y ago
mnpeepno2
mnpeepno2
I remember we had something in the snippets, let me find it for you...

EDIT: Here it is
http://www.mpgh.net/forum/33-visual-...ownloader.html
#2 · edited 15y ago · 15y ago
Blubb1337
Blubb1337
[highlight=VB.NET]'This code is fully self-written.
'Enjoy

Imports System.IO
Imports System.Text
Imports System.Net

'Since a lot of people seem to need a proper downloader, I decided 2 release a PROPER updater
'Most updater use my.network.downloadfile, however this does not show progress and it generally sucks!
'This updater uses a webclient. Using a webclient, you can display the current progress, the received bytes
'and the total bytes to receive.

'You also have a download completed event.

'How to use this?
'This is really easy, the only thing you need to change -> 4 Variables
'links
'Private Const _version As String = "http:/version.txt"
'Private Const _FileToDL As String = "http:/Recorder.exe"
'Private Const _log As String = "http://changelog.txt"
'name
'Private Const _Name As String = "Recorder"

'I think this is pretty self-explanatory. You sure don't need to have a log, you can just take it out.

'Furthermore, this updater uses multithreading to check the newest version/load the checklog.
'Usually the program executes one sub/function/action after another. With multithreads you can run
'different subs/functions or whatever at the same time!
'You may also change the prioritys of the multithreads

'If you want to unpack a file after it has been downloaded, you can go for the sharpziplibrary:
'http://www.mpgh.net/forum/33-visual-basics/126996-tutorial-unzipping-vb-net.html

'Sub ExtractZip(ByVal FileToUnzip As String, ByVal WhereToSave As String, Optional ByVal Password As String = "")
'Dim fz As New FastZip
' fz.Password = Password
' fz.ExtractZip(FileToUnzip, WhereToSave, "")
' End Sub

Public Class Form1

#Region "Declarations"
'new webclient to for downloading
WithEvents webC As New Net.WebClient

Private apppath As String = Application.StartupPath & "\"
Private filename As String

'avoid the same filename twice
Private i As Integer = 1

'received/total bytes
Private total, current As Integer

'links
Private Const _version As String = "http://version.txt"
Private Const _FileToDL As String = "http://Recorder.exe"
Private Const _log As String = "http://changelog.txt"

'name
Private Const _Name As String = "Recorder"

'get a pages source code
Private Function loadPage(ByVal page As String)
Return webC.downloadstring(page)
End Function

#End Region

#Region "Download/Progress"

Private Sub cmdDownload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDownload.Click
If cmdDownload.Text = "Download" Then
'start backgroundworker
bgwDownload****nWorkerAsync()
Else
'start the program
Process.Start(filename)
'end this application
Application.Exit()
End If
End Sub

Private Sub webC_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles webC.DownloadFileCompleted
' MsgBox("Download complete." & vbNewLine & vbNewLine _
' & "Saved at: " & filename)

cmdDownload.Text = "Start " & _Name
cmdDownload.Enabled = True
End Sub

Private Sub webC_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles webC.DownloadProgressChanged
current = e.BytesReceived 'bytes it dled already
total = e.TotalBytesToReceive 'total bytes it has to dl

If total <> current Then 'if they are not the same
cmdDownload.Enabled = False
End If

pbProgress.Value = e.ProgressPercentage 'show the procent percentage
'pbProgress.Text = CInt(current / 1024) & "/" & CInt(total / 1024) & " KB received | " & e.ProgressPercentage & " %"
lblprogress.Text = CInt(current / 1024) & "/" & CInt(total / 1024) & " KB received | " & e.ProgressPercentage & " %"
End Sub

Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgwDownload.DoWork
'start downloading the file
webC.DownloadFileAsync(New Uri(_FileToDL), filename)
End Sub

#End Region

#Region "Startup"

Private Sub UpdateApp_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'to avoid threadovertaking actions -> program would just end
Control.CheckForIllegalCrossThreadCalls = False

'multithread so multiple things can be done at the same time -> load changelog
Dim cl As New Threading.Thread(AddressOf changelog)
cl.Priority = Threading.ThreadPriority.Highest
cl.Start()

'show the current version of the application
lblCurV.Text &= Application.ProductVersion

'to not replace the old version
Do While IO.File.Exists(apppath & _Name & "_Updated - " & i & ".exe")
i += 1
Loop

filename = apppath & _Name & "_Updated - " & i & ".exe"
End Sub

Private Sub changelog()
txtChangeLog.Text = loadPage(_log)
End Sub

Private Sub newversion()
lblNewV.Text &= loadPage(_version)
End Sub

Private Sub UpdateApp_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
Dim checkv As New Threading.Thread(AddressOf newversion)
checkv.Priority = Threading.ThreadPriority.Highest
checkv.Start()
End Sub

#End Region
End Class[/highlight]

Pretty old source, released it on MPGH...
#3 · edited 15y ago · 15y ago
karldeovbnet
karldeovbnet
thank you very much, problem solved
#4 · 15y ago
Blubb1337
Blubb1337
Glad I could help, if you have any issues with the source, tell me.
#5 · 15y ago
Jason
Jason
Marked as solved, nice work Kevin.

No moar posting!
#6 · 15y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None