Horje
htmlagility treeview Code Example
htmlagility treeview
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(html);
TreeNode root = new TreeNode("HTML");
treeView1.Nodes.Add(root);

LoadTree(root, doc.DocumentNode);


void LoadTree(TreeNode treeNode, HtmlAgilityPack.HtmlNode rootNode)
{
    foreach (var node in rootNode.ChildNodes.Where(n=>n.Name!="#text"))
    {
        TreeNode n = new TreeNode(node.Name);
        node.Attributes.Select(a => a.Name + "=" + a.Value)
                       .ToList()
                       .ForEach(x => n.Nodes.Add(x));
        treeNode.Nodes.Add(n);

        LoadTree(n, node);
    }
}




Html

Related
HTML5 Video tag not working Safari iPhone iPad video webpage supported Code Example HTML5 Video tag not working Safari iPhone iPad video webpage supported Code Example
how to add particle js in html Code Example how to add particle js in html Code Example
tips for a perfect cake Code Example tips for a perfect cake Code Example
how to redirect to another html page in html in 30 seconds Code Example how to redirect to another html page in html in 30 seconds Code Example
tailwind checkmark color Code Example tailwind checkmark color Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10