Create <ul> & <li> from System.Windows.Forms.Treeview C#

I wanted to create ul HTML tag and li HTML tag dynamically from the System.Windows.Forms.Treeview using C#. I have a list of absolute path and I am able to create treeview from the list of absolute path, Now I am trying to create ul HTML tag and li HTML tag from the System.Windows.Forms.Treeview using C#. Below is the code which I am using to create System.Windows.Forms.Treeview from the list of absolute path.

List<string> reportsNFoldersInRoot = new List<string>();
reportsNFoldersInRoot.Add("/Report_3/ABCD/PQR/Test_8");
reportsNFoldersInRoot.Add("/Report_3/ABCD/MNO/Test_7");
reportsNFoldersInRoot.Add("/Report_3/EFG/XYZ/Test_9");

        System.Windows.Forms.TreeView treeView = new System.Windows.Forms.TreeView();
        System.Windows.Forms.TreeNode lastNode = null;
        string subPathAgg;
        foreach (string path in reportsNFoldersInRoot)
        {
            subPathAgg = string.Empty;
            foreach (string subPath in path.Split('/'))
            {
                if (string.IsNullOrEmpty(subPath)) { continue; }
                subPathAgg += subPath + "/";
                System.Windows.Forms.TreeNode[] nodes = treeView.Nodes.Find(subPathAgg, true);
                if (nodes.Length == 0)
                if (lastNode == null)
                    lastNode = treeView.Nodes.Add(subPathAgg, subPath);
                else
                    lastNode = lastNode.Nodes.Add(subPathAgg, subPath);
                else
                    lastNode = nodes[0];
                }
         }
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum