Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string filepath = label4.Text;
- DirectoryInfo rootDir = new DirectoryInfo(filepath);
- foreach (var file in rootDir.GetFiles())
- {
- ExtensionInfo info;
- if (extensionInfo.TryGetValue(file.Extension, out info) && info.IsIncluded)
- {
- label5.Text = info.Description;
- }
- }
- if (filesacc != null)
- {
- foreach (FileInfo fi in filesacc)
- {
- files.Add(fi.FullName.ToString());
- label8.Text = fi.FullName;
- }
- }
- subDirs = rootDir.GetDirectories();
- foreach (DirectoryInfo dirInfo in subDirs)
- {
- try
- {
- foreach (string GFI in Directory.GetFiles(dirInfo.FullName, ext, SearchOption.AllDirectories))
- {
- label7.Text = Path.GetDirectoryName(GFI);
- label8.Text = Path.GetFileName(GFI);
- files.Add(GFI);
- label7.Text = "Directory";
- label8.Text = "File";
- }
- }
- catch (UnauthorizedAccessException) { }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement