다음을 통해 공유


WebBrowserProgressChangedEventArgs.CurrentProgress 속성

정의

다운로드된 바이트 수를 가져옵니다.

public:
 property long CurrentProgress { long get(); };
public long CurrentProgress { get; }
member this.CurrentProgress : int64
Public ReadOnly Property CurrentProgress As Long

속성 값

다운로드가 완료되었음을 나타내기 위해 로드되거나 -1 바이트 수입니다.

예제

다음 코드 예제에서는이 멤버의 사용을 보여 줍니다. 이 예제에서 이벤트 처리기는 이벤트의 발생을 보고합니다 WebBrowser.ProgressChanged . 이 보고서는 이벤트가 발생하는 시기를 파악하는 데 도움이 되며 디버깅에 도움이 될 수 있습니다. 여러 이벤트 또는 자주 발생하는 이벤트에 대해 보고하려면 메시지를 여러 줄MessageBox.ShowConsole.WriteLine 대체 TextBox 하거나 추가해 보세요.

예제 코드를 실행하려면 이름이 지정된 WebBrowser형식 WebBrowser1 의 인스턴스가 포함된 프로젝트에 붙여넣습니다. 그런 다음 이벤트 처리기가 이벤트와 연결되어 있는지 확인합니다 WebBrowser.ProgressChanged .

private void WebBrowser1_ProgressChanged(Object sender, WebBrowserProgressChangedEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "CurrentProgress", e.CurrentProgress );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "MaximumProgress", e.MaximumProgress );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ProgressChanged Event" );
}
Private Sub WebBrowser1_ProgressChanged(sender as Object, e as WebBrowserProgressChangedEventArgs) _ 
     Handles WebBrowser1.ProgressChanged

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "CurrentProgress", e.CurrentProgress)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "MaximumProgress", e.MaximumProgress)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"ProgressChanged Event")

End Sub

설명

이 속성을 사용 하 여 컨트롤에 현재 탐색 진행률을 표시할 수 있습니다 ProgressBar . 이 MaximumProgress 속성을 사용하여 다운로드할 수 있는 총 바이트 수를 결정합니다.

적용 대상

추가 정보