In this article i will show you how you can read and html file content or html file tag in you C# application. So for this article first we will create a new console application and create a test html file.
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace ConsoleApp1 { class Program { static void Main(string[] args) { using (StreamReader reader = new StreamReader("Template/TestHTMLFile.html")) { string line = ""; StringBuilder stringBuilder = new StringBuilder(); while ((line = reader.ReadLine()) != null) { stringBuilder.Append(line); } Console.WriteLine(stringBuilder.ToString()); Console.ReadLine(); } } } } |
Now run the application by putting a break point. You will be able to read the detail.
Now check the final output.
Download
0 comments:
Please let me know your view