Dim trv As WinForm.TreeView = Forms("窗口1").Controls("TreeView1") trv.nodes.Clear Dim dt As DataTable = DataTables("授权") For Each dr As DataRow In dt.Select("用户 is not null") For Each s As String In dr("用户").split(",") Dim nd As WinForm.TreeNode If trv.nodes.Contains(s) Then nd = trv.nodes(s) Else nd = trv.nodes.add(s) End If Dim cnd As WinForm.TreeNode If nd.Nodes.Contains(dr("分组")) = False Then cnd = nd.nodes.add(dr("分组")) End If If dr("权限") > "" Then If cnd.Nodes.Contains(dr("权限")) = False Then cnd.nodes.add(dr("权限")) End If End If Next Next
|