none
WebBrowser's DocumentText property throws FileNotFoundException? RRS feed

  • Question

  • After this cumulative security update for IE is installed:

    http://support.microsoft.com/?kbid=2719177

    The DocumentText getter property (and probably setter, too) of System.Windows.Forms.WebBrowser throws FileNotFoundException. It isn't supposed to:

    http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.documenttext.aspx

    What's going on? Is the security update going to persist? If so, then the DocumentText property is worthless. (I can see removing the setter, but I should be able to continue to invoke the getter to see the HTML content rendered in the WebBrowser.)

    Friday, July 13, 2012 5:46 PM

Answers

  • Can't repro:

    Public Class Form1
      
    Dim WB As New WebBrowser
      
    Dim TB As New TextBox
      
    Protected Overrides Sub OnLoad(e As System.EventArgs)
        
    MyBase.OnLoad(e)
        
    AddHandler WB.DocumentCompleted, AddressOf WB_Complete
        WB.Navigate(
    "www.msn.com")
        TB.Parent = 
    Me
        TB.Multiline = 
    True
        TB.Dock = 
    DockStyle.Fill
      
    End Sub
      
    Sub WB_Complete(sender As Object, e As WebBrowserDocumentCompletedEventArgs)
        
    If WB.Url = e.Url Then
          
    If WB.ReadyState = WebBrowserReadyState.Complete Then
            TB.Text = WB.DocumentText
          
    End If
        
    End If
      
    End Sub
    End Class




    Friday, July 13, 2012 10:58 PM