Jan 23, 2015 12:52 PM
(This post was last modified: Jan 23, 2015 12:55 PM by nezinau.)
Hello HF, I am trying to make a little application which opens imported links and then simply searches for specific text. If text haven't been found - then drop that link in another multi line textbox. I was able to make it till this point, but I am not able to make it run multiple links.
For example, I am able to run only one line, but not able to enter any more lines - just one, because then it doesn't work.
Can anyone help me go though each one link in the webbrowser and then paste ones, whom text was not founded in another multi line textbox without overwriting first line?
I am using this for saving link - TextBox2.Text = WebBrowser1.Url.ToString
Thanks, i hope someone could help me out there.
here's the whole code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("someforum")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ofd As New OpenFileDialog()
ofd.Filter = "Text Files (*.txt)|*.txt" 'used for importing links
If (ofd.ShowDialog() = Windows.Forms.DialogResult.OK) Then
Dim sr As New System.IO.StreamReader(ofd.FileName)
TextBox1.Text = sr.ReadToEnd()
sr.Close()
Dim count As Integer = TextBox1.Lines.Length
Label19.Text = count.ToString() 'counts number of imported links to check
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
WebBrowser1.Navigate(TextBox1.Text) 'opens imported link in webbrowser. not sure if this is the way to do it if I want to go thought like 100 lines
Delay(2)
If Me.WebBrowser1.DocumentText.Contains("textiwanttofind") Then
MsgBox("Successfully found!") 'does nothing if text has been found. just displays msgbox
Else
TextBox2.Text = WebBrowser1.Url.ToString 'saves to another textbox if specific text was not found
End If
For example, I am able to run only one line, but not able to enter any more lines - just one, because then it doesn't work.
Can anyone help me go though each one link in the webbrowser and then paste ones, whom text was not founded in another multi line textbox without overwriting first line?
I am using this for saving link - TextBox2.Text = WebBrowser1.Url.ToString
Thanks, i hope someone could help me out there.
here's the whole code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("someforum")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ofd As New OpenFileDialog()
ofd.Filter = "Text Files (*.txt)|*.txt" 'used for importing links
If (ofd.ShowDialog() = Windows.Forms.DialogResult.OK) Then
Dim sr As New System.IO.StreamReader(ofd.FileName)
TextBox1.Text = sr.ReadToEnd()
sr.Close()
Dim count As Integer = TextBox1.Lines.Length
Label19.Text = count.ToString() 'counts number of imported links to check
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
WebBrowser1.Navigate(TextBox1.Text) 'opens imported link in webbrowser. not sure if this is the way to do it if I want to go thought like 100 lines
Delay(2)
If Me.WebBrowser1.DocumentText.Contains("textiwanttofind") Then
MsgBox("Successfully found!") 'does nothing if text has been found. just displays msgbox
Else
TextBox2.Text = WebBrowser1.Url.ToString 'saves to another textbox if specific text was not found
End If

