Advertisement
tankcr

Untitled

May 20th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.65 KB | None | 0 0
  1.                 foreach (var file in rootDir.GetFiles())
  2.                 {
  3.                     ExtensionInfo info;
  4.                     if (extensionInfo.TryGetValue(file.Extension, out info) && info.IsIncluded)
  5.                     {
  6.                         label5.Text = info.Description;
  7.                     }
  8.                 }
  9.  
  10. //                foreach (string ext in extensions)
  11. //                {
  12. //                    try
  13. //                    {
  14. //                        filesacc = rootDir.GetFiles(ext);
  15. //                        if (ext == "*.mp3")
  16. //                        { label5.Text = "MP3 Audio"; }
  17. //                        else if (ext == "*.m4a")
  18. //                        { label5.Text = "iTunes AAC Audio"; }
  19. //                        else if (ext == "*.m4b")
  20. //                        { label5.Text = "iTunes Audio Book"; }
  21. //                        else if (ext == "*.m4v")
  22. //                        { label5.Text = "iTunes Video"; }
  23. //                        else if (ext == "*.m4p")
  24. //                        { label5.Text = "iTunes Protected Audio"; }
  25. //                        else if (ext == "*.flac")
  26. //                        { label5.Text = "Lossless Flac Audio"; }
  27.  //                       else if (ext == "*.wav")
  28.  //                       { label5.Text = "Windows Audio"; }
  29. //                        else if (ext == "*.mp4")
  30. //                        { label5.Text = "Mp4 Audio/Video"; }
  31. //                    }
  32. //                    catch (UnauthorizedAccessException)
  33. //                    { }
  34.                     if (filesacc != null)
  35.                     {
  36.                         foreach (FileInfo fi in filesacc)
  37.                         {
  38.                             files.Add(fi.FullName.ToString());
  39.                             label8.Text = fi.FullName;
  40.                         }
  41.                     }
  42.                     subDirs = rootDir.GetDirectories();
  43.                     foreach (DirectoryInfo dirInfo in subDirs)
  44.                     {
  45.                         try
  46.                         {
  47.                             foreach (string GFI in Directory.GetFiles(dirInfo.FullName, ext, SearchOption.AllDirectories))
  48.                             {
  49.                                 label7.Text = Path.GetDirectoryName(GFI);
  50.                                 label8.Text = Path.GetFileName(GFI);
  51.                                 files.Add(GFI);
  52.                                 label7.Text = "Directory";
  53.                                 label8.Text = "File";
  54.                             }
  55.                         }
  56.                         catch (UnauthorizedAccessException) { }
  57.                     }
  58.  
  59.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement