Visual C#.NET: Read HTML Content

How to read HTML contents using C#.NET
Besides reading PDF and word docments, sometimes users need to read the html content or just a few lines from a certain URL. Here is a professional tool - Yiigo.Image for .NET, allowing html reading with great easy.Find more HTML reading information on Yiigo.Image for .NET.
Yiigo.Image for .NET has those following functionalities:
  • Read html content
  • Extract content
  • Read html line
  • Save and print HTML contents
This content provides comprehensive Visual C#.NET samples for guiding developers to read, print, convert HTML files using Yiigo.Image for .NET. Find more HTML viewing & conversion tutorials on VB.NET HTML Reading, Web Imaging Viewer HTML Reading Support and Read HTML Contents in .NET Winforms.
Read HTML Contents with C#.NET Sample Code

Requirements

Before reading HTML contents in Visual C#.NET, make sure that you have installed.
  • Operating systems - Windows 7, Windows Vista, and Windows XP, etc
  • Compatible with .NET framework 2.0 and above versions
  • Support Visual Studio 2005, 2010 and other .NET development environments
  • Yiigo.Image for .NET installation

Start to Read HTML Contents

  • Open and run your Microsoft Visual Studio;
  • Choose either "Visual C# Projects" in "New Project" dialog box;
  • Choose "Windows Application" in the "Templates" List and name it "YiigoImagingHTMLReadCsharp";
  • Right-click on the "References" folder, and select "Add Reference..." from the context menu in the "Solution Explorer" window;
  • In the "Add Reference" dialog box, select the ".NET" tab and browse to Yiigo.Imaging.Net.dll library;
  • Add it to your Visual C# applications;
  • Call Yiigo .NET Image Namespace & Copy those following codes:
using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;

// load html content
YiigoImage doc= new YiigoImage();
doc.load("http://www.yiigo.com");

//Extract content from HTML
public void ExtractText();
{
doc.load("http://www.yiigo.com");
doc.ReadLine = "56";
doc.OutputFile = OutputFormat.txt;
doc.save(@"C:/extract.txt");
};
public void ExtractText("http://www.yiigo.com","0","4", (@"C:/extract.txt"));

// print & save html content
public void Print();
public void Save();
Products
Other Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner