Ultra Frosty Posted July 28, 2004 Share Posted July 28, 2004 How do you read a file and look to see if it has certaint text ? Link to comment Share on other sites More sharing options...
0 Original_ Posted July 28, 2004 Share Posted July 28, 2004 Open file... run a regular expression. Link to comment Share on other sites More sharing options...
0 Ultra Frosty Posted July 29, 2004 Author Share Posted July 29, 2004 I dont understand what you mean. If I knew how to use the expression correctly I wouldn't have had to post. I am starting to think that this isn't even possible in .NET, kinda sad. Link to comment Share on other sites More sharing options...
0 lexecutil Posted July 29, 2004 Share Posted July 29, 2004 Do something like: StreamReader reader = new StreamReader("PATH"); string text = reader.ReadToEnd(); if (text.IndexOf("Text To Find") != -1) { MessageBox.Show("Found the text!"); } reader.Close(); :) Dan Link to comment Share on other sites More sharing options...
Question
Ultra Frosty
How do you read a file and look to see if it has certaint text ?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts