Program to burn their own data into a lot of CDs, I found it hard to find my own files on which disc I needed, so I wrote a program in Visual Studio.NET to list all the subdirectories and files in the directory to make it easier for me to list all the file information on the CD that I burned.
The main algorithm of this program is recursion, the main function is as follows:
Recursively lists all files and subdirectories under the directory
public void Listfiles (FileSystemInfo fileinfo)
{
if (! FileInfo. Exists) return;
DirectoryInfo dirinfo = FileInfo as DirectoryInfo;
Listfiles (Files[i]); Recursive calls to subdirectories
}
}
indent--;//indent minus One
}
The design interface of the program is shown in the following illustration:
Control has two button controls Btnselect and Btnsave (used to select directories and save files, respectively); a RichTextBox control (displays the results), A FolderBrowserDialog control (select directory) and a SaveFileDialog control (choose Save File Path).
The interface of the program after the operation is shown in the following illustration:
The complete code for the program is as follows: (where I added the red)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.