/// <summary> /// 加载Html树 /// </summary> private void LoadHtml() { WebBrowser1.DocumentText = mTree.GetHtml(); TxtHtml.Text = mTree.Html; TView1.Nodes.Clear(); for (int i = 0; i < mTree.Nodes.Count; i++) { HtmlNode sHtmlNode = mTree.Nodes[i]; TreeNode sTreeNode = null; if (sHtmlNode.TagName != "TEXT") { sTreeNode = new TreeNode("<" + sHtmlNode.TagName + ">", sHtmlNode.ImageIndex, sHtmlNode.ImageIndex); } else { if (sHtmlNode.TextDecoded.Trim().Length > 0) { sTreeNode = new TreeNode("<" + sHtmlNode.TagName + ">:" + sHtmlNode.TextDecoded, sHtmlNode.ImageIndex, sHtmlNode.ImageIndex); } } if (sTreeNode != null) { sTreeNode.Tag = sHtmlNode; sHtmlNode.Tag = sTreeNode; TView1.Nodes.Add(sTreeNode); AddTreeNode(sTreeNode, sHtmlNode); ConditionExpand(sTreeNode); } } }