Can anyone please spend a little time and help me with this code
what i want is to extract the text placed between "<h2>Welcome, " and "</h2>".
Thx alot
VB.NET:
Private Sub WebBrowser1_DocumentNavigated(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If Me.WebBrowser1.DocumentText.Contains("Welcome,") = True Then
Dim MSDNpage As String = WebBrowser1.Document.Body.InnerText
My.Computer.FileSystem.WriteAllText("C:\pp2.txt", MSDNpage , True)
Dim StartIndex As Integer = MSDNpage.EndsWith("<h2>Welcome, ")
Dim EndIndex As Integer = MSDNpage.StartsWith("</h2>")
Dim name As String = MSDNpage.Substring(StartIndex + 20, EndIndex - StartIndex - 20).Trim
MessageBox.Show(name)
End If
End Sub
Thx alot