Need to create a directory tree. Suppose it is clear how to view all the files in the directory and all the folders, and how, after viewing all this, go to the directory above or below?
string path = Directory.GetCurrentDirectory(); string[] files = Directory.GetFiles(path); string[] directory = Directory.GetDirectories(path); for (int i = 0; i < 10; i++) { label2.Text = label2.Text + files[i].ToString() + "\r\n"; } for (int j = 0; j < 10; j++) { label3.Text = label3.Text + directory[j].ToString() + "\r\n"; } I'm not sure that I’m doing all this right, but as I know. And another question: how to determine the number of files or folders in a directory to register it in the condition?