I know how to read a line in a txt file but for some reason C# is not detecting the end of line on HTML files. This code basically opens the html file and tries to parse line by line in search of the specified string. Even when just trying to print the first line of text in the HTML file nothign is displayed.
using (StreamReader sr = new StreamReader("\\\\server\\myFile.html")) { String line; while ((line = sr.ReadLine()) != null) { if(line == ("<td><strong>String I wantstrong></td>")) { Label1.Text = "Text Found"; break; } } }
I have tried this using a plain txt file and it works perfectly, just not when trying to parse an HTML file.
Thanks.