dawd awdaw awd wad
Printable View
dawd awdaw awd wad
Maybe you could explain what you expect to happen and what actually does happen, rather than expecting us to work it out from code that, by your own admission, doesn't actually do what it's supposed to.
i have 3 checkboxes so iim trying to do if you select 1 and click on at button it will download it but i cant do it with 2 checkboxes pls help me
Yeah, yeah, we know you can't do it. If you could then you wouldn't be posting. Now maybe you could actually read the words I posted and do as I asked. If you can't be bothered to provide an explanation of what you expect to happen and what actually happens then I can't be bothered to read your code. What you're saying is:I'm more than happy to help; otherwise I wouldn't be posting. What I'm not prepared to do is waste my time trying to work things out that you already know and could explain if you were prepared to spend a couple of minutes to help us help you.Quote:
It's too much like hard work for me to take the time to explain anything to you so I'd rather that you, someone whom I've never met, spent your time to read my code and first of all work out where the issue is without any guidance from me, then work out how to fix it and tell me while I just take it easy here. I'm sure that you don't have anything better to do.
if wi say there are 3 checkboxes i want i you select all 3 checkboxes there come 3 downloads if you select 2 checkboxes there come 2 downloads and i you select 1 there come 1 download and a progressbar
and setstatus enabled for all downloads
After having the same issue of understanding Kris914g lack of explaining John i provided him/her with a working example that can be found Here. Do not post repeated threads Kris. Especially as the question has already been answered. If you struggled to adapt my post then after for further assistance. I am not going to completely write this out for you. Help your self by trying.
im not undstand the code pls can you edit inside my code in the checkboxes
Why are you using this silly little NextCheck variable? Both your downloads would if called update the same controls so how would you know which webclient it is.
Take the time and effort to explain in full and clear.
DownLoadFileAsync is on a threaded pool. It sounds like to me you wish to download each file individual and update the progress while not blocking the calling thread.
yes is that im trying to do
I just took a closer look and tested the suspiciously named Crack Manager.exe executable and it did return Detection ratio:1 / 47 Trojan.DownLoader9.38064 i am a little suspect of helping you now.
Oh i see now. You are making a program that downloads dreamweaver along side a patched exe. Sorry you are on your own :)
Original cod before editing
vb Code:
Imports System.Net Imports System.IO Imports System.Diagnostics Public Class Form1 Private WithEvents WC2 As WebClient Private WithEvents WC As WebClient #Region "Download RateVariables" Private ChangeInAmount As Integer Private PreviousAmount As Integer Private NextCheck As DateTime #End Region Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load setstatus("0 kb", "0kb", "0%", "0kb/s") WC = New WebClient WC2 = New WebClient End Sub Private Sub setstatus(ByVal CurDownload As String, ByVal TotalDownload As String, ByVal Percentage As String, ByVal Rate As String) Label1.Text = "Downloaded : " & CurDownload Label2.Text = "Download Size : " & TotalDownload Label3.Text = "Rate : " & Rate Label4.Text = "Percentage : " & Percentage End Sub Public Function CalculateRate(ByVal Input As Integer) As String Return Processbytes(Input) & "/s" End Function Public Function Processbytes(ByVal Input As Integer) As String 'Check if the file is 1GB or more If Input >= 1073741824 Then Return Math.Round(CDbl(Input / 1073741824), 2) & " GB" Else 'Check for MB If Input >= 1048576 Then Return Math.Round(CDbl(Input / 1048576), 2) & " MB" Else 'Can only be in KB Return Math.Round(CDbl(Input / 1024), 2) & " KB" End If End If End Function Private Function CDb1(ByVal p1 As Double) As Double Throw New NotImplementedException End Function Private Sub WC_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WC.DownloadFileCompleted ProgressBar1.Value = 0 ProgressBar1.Maximum = 0 ChangeInAmount = 0 PreviousAmount = 0 NextCheck = Now.AddSeconds(1) End Sub Private Sub WC2_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WC.DownloadFileCompleted ProgressBar1.Value = 0 ProgressBar1.Maximum = 0 ChangeInAmount = 0 PreviousAmount = 0 NextCheck = Now.AddSeconds(1) End Sub Private Sub WC_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles WC.DownloadProgressChanged Try If Now > NextCheck Then ChangeInAmount = e.BytesReceived - PreviousAmount PreviousAmount = e.BytesReceived NextCheck.AddSeconds(1) End If Dim Rate As String = CalculateRate(ChangeInAmount) ProgressBar1.Maximum = e.TotalBytesToReceive ProgressBar1.Value = e.BytesReceived setstatus(Processbytes(e.BytesReceived), Processbytes(e.TotalBytesToReceive), e.ProgressPercentage, Rate) Catch End Try End Sub Private Sub WC2_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles WC.DownloadProgressChanged Try If Now > NextCheck Then ChangeInAmount = e.BytesReceived - PreviousAmount PreviousAmount = e.BytesReceived NextCheck.AddSeconds(1) End If Dim Rate As String = CalculateRate(ChangeInAmount) ProgressBar1.Maximum = e.TotalBytesToReceive ProgressBar1.Value = e.BytesReceived setstatus(Processbytes(e.BytesReceived), Processbytes(e.TotalBytesToReceive), e.ProgressPercentage, Rate) Catch End Try End Sub Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click Dim webAddress As String = "https://dl.dropboxusercontent.com/u/45798270/download%20Manager/Adobe/Dreamweaver%20CS6%20Setup.exe" Dim SFD As New SaveFileDialog If SFD.ShowDialog() = DialogResult.OK Then WC.DownloadFileAsync(New Uri("https://dl.dropboxusercontent.com/u/45798270/download%20Manager/Adobe/Dreamweaver%20CS6%20Setup.exe"), SFD.FileName) End If End Sub Private Sub SearchForUpdateToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SearchForUpdateToolStripMenuItem.Click CheckForUpdates() End Sub Public Sub CheckForUpdates() Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://dl.dropboxusercontent.com/u/45798270/download%20Manager/Update/Tool%20update.txt") Dim response As System.Net.HttpWebResponse = request.GetResponse() Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) Dim newestversion As String = sr.ReadToEnd() Dim currentversion As String = Application.ProductVersion If newestversion.Contains(currentversion) Then msgbox("You are up todate :D") Else msgbox("There is a new update we will download it now for you.") System.Diagnostics.Process.Start("https://dl.dropboxusercontent.com/u/45798270/download%20Manager/Update/Crack%20Manager.exe") End If End Sub Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click If CheckBox1.Checked = True Then Dim webAddress As String = "https://dl.dropboxusercontent.com/u/185853590/download%20Manager/Update/Tool%20update.txt" Dim SFD As New SaveFileDialog If SFD.ShowDialog() = DialogResult.OK Then WC.DownloadFileAsync(New Uri("https://dl.dropboxusercontent.com/u/185853590/download%20Manager/Update/Tool%20update.txt"), SFD.FileName) End If End If If CheckBox2.Checked = True Then Dim webAddress2 As String = "https://dl.dropboxusercontent.com/u/185853590/download%20Manager/Update/Tool%20update.txt" Dim SFD As New SaveFileDialog If SFD.ShowDialog() = DialogResult.OK Then WC2.DownloadFileAsync(New Uri("https://dl.dropboxusercontent.com/u/185853590/download%20Manager/Update/Tool%20update.txt"), SFD.FileName) End If End If End Sub End Class
A little fishy, huh?Quote:
Original cod before editing
You do make me chuckle pouncing on the Typo's :D. Need new batteries in keyboard.
Is there a reason why the original thread post was edited out here? Sort of makes this thread useless.
The question was regarding making a down-loader of cracked application's. The OP forgot to edit his url links out that contained infected cracks.
so in other words, this thread can be locked and sink to the bottom of the forum ocean...