Ikillnukes

Código fail de busqueda por Google

Aug 13th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.12 KB | None | 0 0
  1.     Dim oNombre As String
  2.  
  3.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  4.         Try
  5.  
  6.             For Each oNombre As String In TextBox1.Text.Replace(Environment.NewLine, ",").Split(",")
  7.  
  8.  
  9.                 'MsgBox("https://www.google.com/search?q=" & oNombre)
  10.  
  11.                 WebBrowser1.Navigate("https://www.google.com/search?q=" & oNombre)
  12.                 AddHandler WebBrowser1.DocumentCompleted, AddressOf WebBrowser1_DocumentCompleted
  13.  
  14.             Next 'oNombre
  15.  
  16.         Catch ex As Exception When TextBox1.Text = String.Empty
  17.             MsgBox("Error: Debe escribir algo en la casilla de Texto", MsgBoxStyle.Critical, "Error")
  18.         End Try
  19.     End Sub
  20.  
  21.     Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
  22.         Dim preresultStats As String = WebBrowser1.Document.GetElementById("ResultStats").InnerHtml
  23.         Dim resultStats As String = Regex.Replace(preresultStats, "<nobr> |&nbsp;|<\/nobr>", "")
  24.         MsgBox(oNombre & ", ha obtenido:" & resultStats)
  25.     End Sub
Add Comment
Please, Sign In to add comment