When you say "set a specified node in treeview", I'm guess you're talking about setting the SelectedNode. Again, this code assumes that you have stored a distinct value to each node's Tag property, and are passing that value into this method.
public void SetActiveNode(string sNodeTag)
{
foreach (TreeNode oNode in treeView1.Nodes)
{
if ((string)oNode.Tag == sNodeTag)
{
SelectedNode = oNode;
break;
}
}
}
Everything makes sense in someone's mind