private void button1_Click(object sender, EventArgs e)
{
treeView1.Nodes.Add("My Computers");
TreeNode child = new TreeNode();
TreeNode chNode = new TreeNode();
DirectoryInfo direObj = new DirectoryInfo("F:\\Tushar\\E-Books");
treeView1.Nodes.Add(direObj.Name);
foreach (DirectoryInfo d in direObj.GetDirectories())
{
child .Nodes .Add (d.FullName );
chNode.Nodes .Add (GetDir(d));
}
child.Nodes.Add(chNode);
treeView1.Nodes.Add(child);
}
/* this is the exact logic of creating a treeNode and assigning it
with the directory name or the sub-Directory name or the file name
*/
|