Advertisement
Kimeraweb

Untitled

Sep 21st, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class WebReloader
  2.     Dim bytesC As Integer
  3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.         WebBrowser1.Navigate(TextBox1.Text)
  5.     End Sub
  6.  
  7.     Private Sub WebReloader_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  8.         AddHandler WebBrowser1.DocumentCompleted, New  _
  9.         WebBrowserDocumentCompletedEventHandler(AddressOf RecargaWeb)
  10.     End Sub
  11.  
  12.     Private Sub RecargaWeb()
  13.         If CheckBox1.Checked Then
  14.             WebBrowser1.Navigate(TextBox1.Text)
  15.             bytesC += WebBrowser1.DocumentText.Length
  16.  
  17.             Label_recargas.Update()
  18.             Label_recargas.Text += 1
  19.             Label_bytes_consumidos.Update()
  20.             If Val(Label_recargas.Text) >= Val(limite_recargas.Text) And Not Val(limite_recargas.Text) = 0 Then
  21.                 CheckBox1.Checked = False
  22.             End If
  23.  
  24.         End If
  25.  
  26.         If bytesC < 1024 Then
  27.             Label3.Text = "Bytes consumidos"
  28.             Label_bytes_consumidos.Text = bytesC
  29.         End If
  30.  
  31.         If bytesC >= 1024 And bytesC < 1048576 Then ' KBytes - Menos de 1 MG
  32.            Label3.Text = "KBytes consumidos"
  33.             Label_bytes_consumidos.Text = bytesC / 1024
  34.         End If
  35.  
  36.         If bytesC >= 1048576 And bytesC < 1073741824 Then ' MBytes - Menos de 1 GB
  37.            Label3.Text = "MBytes consumidos"
  38.             Label_bytes_consumidos.Text = bytesC / 1048576
  39.         End If
  40.  
  41.         If bytesC >= 1073741824 Then  ' GBytes
  42.            Label3.Text = "GBytes consumidos"
  43.             Label_bytes_consumidos.Text = bytesC / 1073741824
  44.         End If
  45.  
  46.  
  47.     End Sub
  48.  
  49. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement