Join 300,479 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,757 people online right now. Registration is fast and FREE... Join Now!
As part of the program im making, Warez-One Install Manager I need to have a progress bar so the user doesn't think the program is frozen and I have no idea how to do it here is the code for the 2nd notification window in which the progress bar goes on
Dialog1.vb
CODE
Imports System.Windows.Forms
Public Class Package_Installation
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Me.DialogResult = System.Windows.Forms.DialogResult.OK Me.Close() End Sub
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Me.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.Close() End Sub
Private Sub Package_Installation_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
End Sub
Private Sub Package_Installation_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.GotFocus
End Sub
Private Sub Package_Installation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Finish_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Finish_Button.Click Warez_One_Package_Manager.First_Form.Close() Me.Close() End Sub
Private Sub INSTALLBUTTON1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles INSTALLBUTTON1.Click Me.InstallingSoftware.Show() Me.Installation_Label.Hide()
Me.INSTALLBUTTON1.Hide()
Dim item As Object
System.Threading.Thread.Sleep(100) 'Setting it to pause for 100 miliseconds so you can see the Package_Installation Window
'------------------------------------------------Web Browsers--------------------------------------------------------------- For Each item In First_Form.Browser_CheckListBox.CheckedItems Select Case item.ToString()
Case "Mozilla Firefox" ' Action if the item text is Mozilla Firefox. My.Computer.Network.DownloadFile _ ("http://mozilla.ussg.indiana.edu/pub/mozilla.org/firefox/releases/3.0.5/win32/en-US/Firefox%20Setup%203.0.5.exe", _ "C:\Program Files\Warez-One Package Manager\Downloaded Packages\Firefox_3.05_Setup.exe") 'Where the file goes & above that the url of the file & above that the download command Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Firefox.bat")
Case "SeaMonkey" My.Computer.Network.DownloadFile _ ("http://mirror.cc.vt.edu/pub/mozilla//seamonkey/releases/1.1.14/seamonkey-1.1.14.en-US.win32.installer.exe", _ "C:\Program Files\Warez-One Package Manager\Downloaded Packages\seamonkey-1.114.en-US.win32.installer.exe") Shell("C:\Program Files\Warez-One Install Manage\Silent Installation Scripts\SeaMonkey.bat") ' Action if the item text is SeaMonkey. Case "Opera" My.Computer.Network.DownloadFile _ ("http://opera.releasenotes.org/win/963/en/Opera_963_en_Setup.exe", "C:\Program Files\Warez-One Package Manager\Downloaded Packages\OperaInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Opera.bat") ' Action if the item text is Opera. Case "Safari" My.Computer.Network.DownloadFile _ ("http://appldnld.apple.com.edgesuite.net/content.info.apple.com/Safari3/061-5806.20081124.bOHxyj/SafariSetup.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\SafariInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Safari.bat") ' Action if the item is Safari Case "Flock" My.Computer.Network.DownloadFile _ ("http://ftp.osuosl.org/pub/flock/releases/2.0.3/flock-2.0.3.en-US.win32.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\FlockInstaller.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Flock.bat") '------------------------------------------------Web Browsers---------------------------------------------------------------
End Select Next '--------------------------------------------------------Multimedia------------------------------------------------------------------ Dim itze As Object
For Each itze In First_Form.Multimedia_CheckListBox.CheckedItems
Next Select Case itze.ToString() Case "Pidgin Instant Messenger" My.Computer.Network.DownloadFile _ ("http://internap.dl.sourceforge.net/sourceforge/pidgin/pidgin-2.5.3.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\PidginInstall.exe") 'Downloading Pidgin 2.5.3 into specified directory Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Pidgin.bat") 'Running the silent install script to install pidgin and then remove it from the package manager's downloaded files directory Case "Miranda IM" My.Computer.Network.DownloadFile _ ("http://superb-east.dl.sourceforge.net/sourceforge/miranda/miranda-im-v0.7.13-unicode.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\MirandaIMInstall") Shell("C:\Program Files\Warez-One Install Manager\Silent Installalltion Scripts\MirandaIM.bat") Case "Internet Download Manager" My.Computer.Network.DownloadFile _ ("http://www.internetdownloadmanager.com/idman515.exe", "C:\Program Files\Warez-One Package Install Manager\Downloaded Packages\IDManInstall.exe") Shell("C:\Program Files\Warez-One Package Install Manager\Silent Installation Scripts\IDMAN.bat") Case "Download Accelerator Plus" My.Computer.Network.DownloadFile _ ("http://software-files.download.com/sd/ OEqIbdWD7xKk2ZgvdJrR7MXQ8QXqTvEAXquP_E7V9SRFJOEJnsTBhW2Kjtkpnie9bG3semAdiGt2kCRs inNgflFlWOn-9sjl/software/10993668/10037157/3/dap9.exe?lop=link&ptype=1901&ontid=2071&siteId=4&edId=3&spi=d1eabb20ecd7535c0a9a0783cbb0aca3&pid=10993668&psid=10037157", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\DAPINSTALL.exe") Shell("C:\Program Files\Warez-One Package Install Manager\Silent Installation Scripts\Dap.bat") Case "iTunes 8" My.Computer.Network.DownloadFile _ ("http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iTunes8/061-5812.20081120.3mv63/iTunesSetup.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\iTunesInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\iTunes.bat") Case "Winamp" My.Computer.Network.DownloadFile _ ("http://download.nullsoft.com/winamp/client/winamp5541_full_emusic-7plus_en-us.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\WinampInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\\Winamp.bat") Case "Songbird" My.Computer.Network.DownloadFile _ ("http://download.songbirdnest.com/installer/windows/i686-msvc8/Songbird_1.0.0-860_windows-i686-msvc8.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\SongbirdInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Songbird.bat") Case "ImgBurn" My.Computer.Network.DownloadFile _ ("http://download.betanews.com/download/1128426215/SetupImgBurn_2.4.2.0.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\ImgBurnInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\ImgBurn.bat") Case "UltraISO" My.Computer.Network.DownloadFile _ ("http://dw.ezbsys.net/uiso9_pe.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\UltraISOInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\UltraISO.bat") Case "PowerISO" My.Computer.Network.DownloadFile _ ("http://poweriso.com/PowerISO43.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\PowerISOInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\PowerISO.bat") Case "mIRC" My.Computer.Network.DownloadFile _ ("http://software-files.download.com/sd/25wSTgb91cXN17hT_oov59TVL6wpK1tbv4mSOGCxafGVwEdnVFbPT_CpEQBHgEUjwyrVGoDny61-l-6N18Vf0lYoVBBnb_FB/software/10897267/10001733/3/mirc635.exe?lop=link&ptype=1901&ontid=2150&siteId=4&edId=3&spi=55ce962657276c9ba80421a23b4a51ef&pid=10897267&psid=10001733", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\mIRCInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\mIRC.bat") Case "XChat" My.Computer.Network.DownloadFile _ ("http://www.xchat.org/files/binary/win32/xchat-2.8.7d.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\XChatInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\XChat.bat") '--------------------------------------------------------Multimedia------------------------------------------------------------------ End Select '------------------------------------------------------Security----------------------------------------------------------- Dim ited As Object
For Each ited In First_Form.Multimedia_CheckListBox.CheckedItems
Next Select Case ited.ToString() Case "Spybot Search & Destroy" My.Computer.Network.DownloadFile _ ("http://www.spybotupdates.com/files/spybotsd160.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\SpyBotInstaller.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\SpyBot.bat") Case "Ad-Aware" My.Computer.Network.DownloadFile _ ("http://files3.majorgeeks.com/files/e8aad818fe5983b60b3a41bcc9289803/spyware/aaw2008.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\AAW2008Installer.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Ad-Aware.bat") Case "Avast Anti-Virus Home Edition" My.Computer.Network.DownloadFile _ ("http://software-files.download.com/sd/R3itJy7jgChwDxfY60aaqGf7YEKhFUELkkCmKuR-xhWcbjSuz11uZXekhSVCn18Qse11jVIURgdx52Lx7vrmDC1dgNXXfQs-/software/10888427/10019223/3/setupeng.exe?lop=link&ptype=1901&ontid=2239&siteId=4&edId=3&spi=5a3bffed905f4a25419adf4415459fc2&pid=10888427&psid=10019223", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\AvastInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Avast.bat") Case ("AVG Anti-Virus Free Edition") My.Computer.Network.DownloadFile _ ("http://avg.vo.llnwd.net/o25/inst/avg_free_stf_en_8_176a1400.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\AVGInstall.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\AVG.bat") End Select '----------------------------------------------Security--------------------------------------------------------
'-----------------------------------------------------System--------------------------------------------------- Dim items As Object For Each items In First_Form.System_CheckListBox.CheckedItems Select Case items.ToString Case "Windows XP Service Pack 3 (XP ONLY)" My.Computer.Network.DownloadFile _ ("http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=5b33b5a8-5e76-401f-be08-1e1555d4f3d4&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fd%2f3%2f0%2fd30e32d8-418a-469d-b600-f32ce3edf42d%2fWindowsXP-KB936929-SP3-x86-ENU.exe", "C:\Program Files\Warez-One Install Manager\Downloaded Packages\WinXPSp3.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\WINXPSP3.bat") Case "Bonjour" My.Computer.Network.DownloadFile _ ("http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=21079&cat=59&platform=osx&method=sa/BonjourSetup.exe", "C:\Program Files\Warez-One Install Manager\BonjourInstaller.exe") Shell("C:\Program Files\Warez-One Install Manager\Silent Installation Scripts\Bonjour.bat") End Select Next
'-------------------------------------------Codec Packs----------------------------------------------------------- Dim Codecpack As Object For Each Codecpack In First_Form.Codecpack_CheckListBox.CheckedItems
Do you need the progress bar to show the progress of the download process?
I would like the progressbar to work for each selected file, meaning that it would fill i nthe neccesary amount based on the numbe rof programs selected for example, if the 3 programs selected were Mozilla Firefox, iTunes and Songbird it would fill in a 1/3 for each of those programs
So, it will show the overall download progress for the selected programs? Here is a hint (to be more specific, a formula by which you can calculate the progress, assuming that the maximum value for the progress bar is 100, therefore 100%):
Its saying that Net.Webclient.DownloadFileAsync isnt a member of System.Net.Webclient and I tried to do it in the progressbar window but it said the same thing just for the progress bar
Just to let you know, I'm extremely beginner self taught vbasic .net and thats the only programming language I somewhat know and I can do bash and batch scripting
BTW if this is suppoed to be used as a method of downloading files, I've been using