views:

123

answers:

3

Hi

I am using the system.windows.controls.webbrowser component, I need to display in a different component the amount of bytes downloaded from the moment the component was started, any idea how this can be done?

A: 

The WebBrowserProgressChangedEventArgs.CurrentProgress property can be used to determine the number of bytes downloaded.

Check this link

Shoban
A: 

Handle the WebBrowserProgressChangedEventArgs event of your web control and use the current progress property to get the number of bytes downloaded...

Quick example...

public long progress = 0;

private void webBrowser1_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e)
{
    progress += e.CurrentProgress;
    textBox1.Text = progress.ToString();
}

:)

Chalkey
This component is in System.Windows.Forms, the web browser I am using is in System.Windows.Controls, this component does not have this event.
A: 

I have a similar problem. It seems to me, that e.CurrentProgress doesn't contain the number of bytes but just (e.CurrentProgress / e.MaximumProgress) gets a value to be shown in progress bar.

Any suggestions?

Thank you