Пример #1
0
 private int DFS(HTMLNode now)
 {
     int pos = DFSDocument.Count;
     DFSDocument.Add(now.Info);
     int totchildren = 0;
     foreach(HTMLNode next in now.Children)
         totchildren += DFS(next);
     DFSDocument[pos]["TotChildren"] = totchildren;
     return totchildren;
 }
Пример #2
0
 /// <summary>
 /// 分析源代码
 /// </summary>
 public void AnalyseHTML()
 {
     try
     {
         Document = new HTMLNode("TAG",source);
     }
     catch (Exception ex)
     {
         Document = new HTMLNode("STRING",ex.ToString());
     }
 }
Пример #3
0
 private void DFS(int deep, HTMLNode now)
 {
     foreach (HTMLNode next in now.Children)
         DFS(deep + 1, next);
 }
Пример #4
0
 public HTML()
 {
     source = "";
     Document = new HTMLNode();
 }