|
-
Aug 20th, 2012, 09:03 PM
#1
Thread Starter
New Member
Help with some code [SOLVED]
I am trying to create a program that goes through a text file full of four character lines. It should take each line and send it through www.isthisaword.com. it should then check to see if the website thinks the four letters make up a word. If they do make up a word then it should put the word in a text box and continue to check the other lines. the end result should be a textbox filled with a list of four letter words taken from the text file. As of right now the program only tries to see if the very last four letter string in the text file is a word, and even if it is a word, it does not write it to the textbox. could anyone help me please? P.S. this is pretty much the first program i have ever created, so sorry its not the neatest code.
Example of the text file (over 10,000 of these four letter strings):
tcmv
uwnr
ysun
dnci
csrg
fohj
rtyv
ybmx
xywd
cism
ihju
wkro
huvg
ynts
bwdq
gjvf
mbgd
Code:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Using ofd As New OpenFileDialog()
If ofd.ShowDialog() = DialogResult.OK Then
MessageBox.Show("Selected " + ofd.FileName)
Dim FILE_NAME As String = ofd.FileName
Dim objReader As New System.IO.StreamReader(FILE_NAME)
Dim TextLine As String
Do While objReader.Peek() <> -1
TextLine = objReader.ReadLine() & vbNewLine
WebBrowser1.Navigate("www.isthisaword.com/" + TextLine)
Dim Inner As String = WebBrowser1.Document.Body.InnerHtml
If InStr(Inner, "YES") <> 0 Then
RichTextBox1.Text = RichTextBox1.Text + TextLine & vbnewline
End If
Loop
Else
MsgBox("file does not exist")
End If
End Using
End Sub
Last edited by strpwnsulol; Aug 21st, 2012 at 11:42 AM.
Reason: SOLVED
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|