TechSapphire Friday, 2024-05-10, 4:10 AM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Main » 2012 » November » 2 » Read html, text or content between HTML tag c#. .NET
    0:03 AM
    Read html, text or content between HTML tag c#. .NET
    Read html, text or content between HTML tag c#. .NET

    It is very easy to read content between HTML tag using c#. Steps for reading HTML content are as follows:

    • Using namespace System.Xml
    • Code:

            XmlDocument a=new XmlDocument();
            a.Load(Server.MapPath("~") + "//a.html");
            XmlNode n = a.SelectSingleNode("/html/body");
            TextBox1.Text = n.InnerXml;

           Note:

    • Be sure about case sensitivity of tag example (/HTML/BODY) in place of (/html/body).

    Download source

    Category: Programming | Views: 2686 | Added by: Admin | Tags: Between, Content, .NET, Read text between html tag, html, csharp, Tag, C# | Rating: 0.0/0
    Total comments: 0
    Only registered users can add comments.
    [ Registration | Login ]
    Categories
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SQL SERVER
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024