Results 1 to 8 of 8

Thread: webbrowser control - memory leak - HTTP web request instead of a webbrowser

Threaded View

  1. #1

    Thread Starter
    Banned
    Join Date
    Jan 2009
    Posts
    138

    webbrowser control - memory leak - HTTP web request instead of a webbrowser

    Ok so i have created an app to load an access database into a datagridview, which contains web urls. When button is clicked it webbrowser1 navigates to each url and each webpages document.inertext is put into textbox. This all work fine but after a while the webbrowser navigation becomes increasingly slower. How could i fix this.

    Any help much appreciated.

    Code:
    For Each RW As DataGridViewRow In Me.DataGridView1.SelectedRows
                    '''''''''''#######cell values into strings ########''''''''''''''
                    If RW.Selected = True Then
    
                        Dim domain As String
                        Dim keyword As String
                        Dim location As String
                        Dim space As String
                        space = " "
                        location = RW.Cells(10).Value.ToString
                        keyword = RW.Cells(9).Value.ToString
                        domain = RW.Cells(3).Value.ToString
    
                        Application.DoEvents()
                        If Not WebBrowser1.ReadyState = WebBrowserReadyState.Loading Then
                            If RadioButton1.Checked = True Then
                                WebBrowser1.Navigate("http://www.google.com.au/#q=" & keyword & space & location & "&start=0&hl=en&safe=off&biw=1280&bih=666&prmd=ivnsu&source=lnt&tbs=ctr:countryAU&cr=countryAU&sa=X&ei=WkRNTY-FLIfQcbr2vbkJ&ved=0CAcQpwUoAQ&fp=84eb9b8bc3203d0f")
    
                               
    
                            ElseIf RadioButton2.Checked = True Then
                                WebBrowser1.Navigate("http://www.google.com.au/#q=" & keyword & space & location & "&start=0&hl=en&safe=on&biw=1280&bih=666&prmd=ivnsu&source=lnt&tbs=ctr:countryAU&cr=countryAU&sa=X&ei=WkRNTY-FLIfQcbr2vbkJ&ved=0CAcQpwUoAQ&fp=84eb9b8bc3203d0f")
                                
    
                            ElseIf RadioButton3.Checked = True Then
                                WebBrowser1.Navigate("http://www.google.com.au/#q=" & keyword & space & location & "&start=0&hl=en&safe=moderate&biw=1280&bih=666&prmd=ivnsu&source=lnt&tbs=ctr:countryAU&cr=countryAU&sa=X&ei=WkRNTY-FLIfQcbr2vbkJ&ved=0CAcQpwUoAQ&fp=84eb9b8bc3203d0f")
    
                            End If
                        Else
                            MsgBox(" Did not send url! ")
                        End If
                        Application.DoEvents()
    
                        Delay(NumericUpDown1.Value)
                       
                        TextBox11.Text = WebBrowser1.Document.Body.InnerText.ToString()
                        Delay(NumericUpDown2.Value)
    
                        If Not TextBox11.Text = "" Then
                            If RW.Selected = True Then
                                location = RW.Cells(10).Value.ToString
                                keyword = RW.Cells(9).Value.ToString
                                domain = RW.Cells(3).Value.ToString
    
                                If TextBox11.Text.ToLower.Contains("www." & domain) Then
                                    RW.Cells(7).Value = "1"
    
                                ElseIf TextBox11.Text.ToLower.Contains(domain) Then
                                    RW.Cells(7).Value = "1-MC"
    
                                ElseIf Not TextBox11.Text.ToLower.Contains(domain) Then
                                    RW.Cells(7).Value = "0"
    
                                End If
                                ProgressBar2.Value = 95
                                TextBox11.Text = ""
                            End If
                        Else
                            RW.Cells(7).Value = "Recheck"
                        End If
                    End If
                Next
            End If
    Last edited by carspoo200; Mar 19th, 2011 at 12:04 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width