Well, guys, I'd like some help out of favor
I made a file explorer that aims to map all the folders, subfolders and the files of these folders and subfolders according to the letter that is selected.
The problem is that by selecting any letter, the program shows the folders that start with the selected letter and always shows any files that are not inside a folder on the desktop.
The result looks like this:
The function I used to show the folders and subfolders and the files of both, is this
var directoryNode = new TreeNode(directoryInfo.Name);
var directoryNode = new TreeNode(directoryInfo.Name);
foreach (var directory in directoryInfo.GetDirectories(letra))
directoryNode.Nodes.Add(CreateDirectoryNode(directory, letra));
foreach (var file in directoryInfo.GetFiles())
directoryNode.Nodes.Add(new TreeNode(file.Name));
return directoryNode;
How can I make sure that when I select the letter, only the folders, subfolders, and files of both of them appear? Thanks for the help