private void CreateFolderTree()
{
TreeNode node = new TreeNode();
//Create Root Node
node.Text = "My SmartPhone";
node.Tag = Directory.GetDirectoryRoot("//");
CreateFolderTree( node );
treFolder.BeginUpdate();
treFolder.Nodes.Add( node );
treFolder.EndUpdate();
treFolder.Focus();
}
private void CreateFolderTree(TreeNode node)
{
TreeNode cldNode;
DirectoryInfo dirInfo;
string[] paths;
//Add Directories to ListView
paths = Directory.GetDirectories( (string)node.Tag );
for(int i = 0; i< paths.Length; i++ )
{
dirInfo = new DirectoryInfo( paths[i] );
cldNode = new TreeNode( dirInfo.Name );
cldNode.Tag = paths[i];
node.Nodes.Add( cldNode );
Application.DoEvents();
CreateFolderTree( cldNode );
}
}
{
TreeNode node = new TreeNode();
//Create Root Node
node.Text = "My SmartPhone";
node.Tag = Directory.GetDirectoryRoot("//");
CreateFolderTree( node );
treFolder.BeginUpdate();
treFolder.Nodes.Add( node );
treFolder.EndUpdate();
treFolder.Focus();
}
private void CreateFolderTree(TreeNode node)
{
TreeNode cldNode;
DirectoryInfo dirInfo;
string[] paths;
//Add Directories to ListView
paths = Directory.GetDirectories( (string)node.Tag );
for(int i = 0; i< paths.Length; i++ )
{
dirInfo = new DirectoryInfo( paths[i] );
cldNode = new TreeNode( dirInfo.Name );
cldNode.Tag = paths[i];
node.Nodes.Add( cldNode );
Application.DoEvents();
CreateFolderTree( cldNode );
}
}