string jingyuan = ""; string jinghui = ""; private void DiGui(TreeNode tn) { if (tn.Checked && tn.ImageUrl.Contains("jinghui")) { jinghui += tn.Text+","; } if (tn.Checked && tn.ImageUrl.Contains("jingyuan")) { jingyuan += tn.Text + ","; } foreach (TreeNode tnSub in tn.ChildNodes) { DiGui(tnSub); } }
private bool DoAdd() { foreach (TreeNode node in TreeView1.Nodes)//递归获取TreeView节点值 { DiGui(node); } JscriptMsg(jinghui+"|"+jingyuan, ""); }