public void Progress2( DownloadState ds ) { if (ds.error != null) { label2.Text = ds.error.Status + " " + ds.error.Message; return; } progressBar2.Maximum = (int)ds.BufferRead.Length; progressBar2.Value = ds.bytesRead; label2.Text = ds.Progress().ToString(); if (ds.Progress() == 50) { ds.Abort(); } }
public void Progress1( DownloadState ds ) { if ( ds.error != null ) { label1.Text = ds.error.Status + " "+ ds.error.Message; return; } progressBar1.Maximum = (int)ds.BufferRead.Length; progressBar1.Value = ds.bytesRead; label1.Text = ds.Progress().ToString(); if ( ds.DataLeft() == 0 ) { dw.Download(urlBox.Text, this, Progress2); } }