current position:Home>C # click the button to display the name of the folder on the control

C # click the button to display the name of the folder on the control

2022-02-02 12:59:17 CSDN Q & A

I just haven't written code
Now I want to write a small function ,
Click button , Just display the folder on the control ,
string past = @"E:\123";

        System.Diagnostics.Process.Start(past);        DirectoryInfo folder = new DirectoryInfo(past);                this.richTextBox1.Text= folder + "\n";

This is just to show the file path to the control , The folder inside is not displayed in the control , How to write , Kneel down

img


Just click the query button , The folders under this path are displayed in the control




Refer to the answer 1:

Then you have to cycle through all the folders , Then use string splicing to display .




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202021259155801.html

Random recommended