1 intCount =0;2 intSuccess_count =0;3 foreach(stringGeninchFn_gen)4 {5 //MessageBox.Show (gen);6Bitmap Bi =NewBitmap (gen);//Create a bitmap pair image using an open picture path7Image image =Bi;8 if(Image.width >= the&& Image.height >= $)9 { Ten stringDestinationfile = result + Gen. Substring (Gen. LastIndexOf (@"\"), Gen. Length-gen. LastIndexOf (@"\")); One BOOLIsrewrite =true;//true= Overwrite an existing file with the same name, false instead A System.IO.File.Copy (gen, Destinationfile, isrewrite); -success_count++; - This. Txt_count.refresh (); the This. Txt_count.text = Success_count. ToString () +"/"+count. ToString (); - application.doevents ()///Application.doevents (): Handles all the Windows messages currently in the message queue. -System.Threading.Thread.Sleep ( -); - } +count++; -Bi =NULL; + System.GC.Collect (); A}
C # Control Refresh