Advertisement
tankcr

Untitled

May 20th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.59 KB | None | 0 0
  1.                 string filepath = label4.Text;
  2.                 DirectoryInfo rootDir = new DirectoryInfo(filepath);
  3.  
  4.                 foreach (var file in rootDir.GetFiles())
  5.                 {
  6.                     ExtensionInfo info;
  7.                     if (extensionInfo.TryGetValue(file.Extension, out info) && info.IsIncluded)
  8.                     {
  9.                         label5.Text = info.Description;
  10.                     }
  11.                 }
  12.                     if (filesacc != null)
  13.                     {
  14.                         foreach (FileInfo fi in filesacc)
  15.                         {
  16.                             files.Add(fi.FullName.ToString());
  17.                             label8.Text = fi.FullName;
  18.                         }
  19.                     }
  20.                     subDirs = rootDir.GetDirectories();
  21.                     foreach (DirectoryInfo dirInfo in subDirs)
  22.                     {
  23.                         try
  24.                         {
  25.                             foreach (string GFI in Directory.GetFiles(dirInfo.FullName, ext, SearchOption.AllDirectories))
  26.                             {
  27.                                 label7.Text = Path.GetDirectoryName(GFI);
  28.                                 label8.Text = Path.GetFileName(GFI);
  29.                                 files.Add(GFI);
  30.                                 label7.Text = "Directory";
  31.                                 label8.Text = "File";
  32.                             }
  33.                         }
  34.                         catch (UnauthorizedAccessException) { }
  35.                     }
  36.  
  37.                 }
  38.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement