知道树节点的路径FullPath,有哪个方法可以通过它找到该树节点

	
	//知道树节点的路径FullPath,可以通过以下方法它找到该树节点
	//File.pathSeparator指的是分隔连续多个路径字符串的分隔符
	String delimit = treeView1.PathSeparator
	//treeView1.SelectedNode.FullPath 就是当前选中节点的路径 treeView1 为你的treeview的ID
	String path = treeView1.SelectedNode.FullPath
	String[] kids = path.Split(new string[] { delimit }, StringSplitOptions.RemoveEmptyEntries);
	TreeNode tn = treeView1.Nodes[kids[0]];
	for (int i = 1; i < kids.Length; i++){
	    tn = tn.Nodes[kids[i]];
	}

你可能感兴趣的:(Path,节点,treeview,fullpath)