Advertisement
tankcr

Untitled

May 21st, 2014
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.19 KB | None | 0 0
  1.         private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
  2.         {
  3.             Control.CheckForIllegalCrossThreadCalls = false;
  4.             backgroundWorker2.Dispose();
  5.             backgroundWorker3.Dispose();
  6.             backgroundWorker1.WorkerSupportsCancellation = true;
  7.             label6.Text = null;
  8.             label7.Text = null;
  9.             string filepath = label4.Text;
  10.             string[] allfiles = Directory.GetFiles(filepath, "*.*", SearchOption.AllDirectories);
  11.             string extensionstring = extensions.ToString();
  12.             System.IO.File.WriteAllLines(@filepath+"\\testfiles.txt", allfiles);
  13.             foreach(KeyValuePair<string, string> ext in extensions)
  14.                 {
  15.                     System.IO.File.WriteAllText(@filepath + "\\testext.txt", ext.ToString());        
  16.                     foreach (string file in allfiles)
  17.                         {
  18.                             FileInfo fi = new FileInfo(file);
  19.                             label8.Text = Path.GetFileName(file);
  20.                             if (extensions.ContainsKey(fi.Extension))
  21.                             {
  22.                                 files.Add(fi.FullName.ToString()); label8.Text = fi.FullName;
  23.                                 System.IO.File.WriteAllText("@C:\test.txt",files.ToString());
  24.                             }
  25.                         }
  26.                         foreach (string GFI in files)
  27.                         {
  28.                            label7.Text = Path.GetDirectoryName(GFI);
  29.                            label8.Text = Path.GetFileName(GFI);
  30.                            label7.Text = "Directory";
  31.                            label8.Text = "File";
  32.                         }
  33.                 }
  34.             this.pictureBox3.Image = null;
  35.             Int32 filecount = files.Count;
  36.             label7.Text = "Directories";
  37.             this.pictureBox4.Image = Properties.Resources.music16;
  38.             pictureBox5.Image = MusicLibUtility.Properties.Resources.scanning;
  39.             this.pictureBox1.Image = Properties.Resources.skinitunes;
  40.             label11.Text = "Preparing to scan for corupt media files";
  41.             Thread.Sleep(2000);
  42.  
  43.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement