Spell Check

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text file which contains many words separated by lines, one per line. Is there anyway I could get read each line of text until the line of text matches my string in my application? Something along the lines of this
private void button1_Click(object sender, System.EventArgs e

string words
string searchforme = "look"
System.IO.TextReader tr = System.IO.File.OpenRead("C:\\words.txt")
d

words = tr.ReadLine()

while(words == searchforme = false)
if(words = searchforme

MessageBox.Show("Found a match")

els

MessageBox.Show("No match found")

}
 
<ciach>
{
string words;
string searchforme = "szukany tekst";
System.IO.StreamReader tr = new
System.IO.StreamReader("plik.txt",System.Text.Encoding.Default);
do
{
words = tr.ReadLine();
}
while((words != null) && (words != searchforme));
if(words != null)
{
MessageBox.Show("Znalaz³em!!");
}
else
{
MessageBox.Show("Nie znalaz³em :(");
}
}

pozdrawiam
Przemek Sulikowski
 
Back
Top