zoukankan      html  css  js  c++  java
  • C#控件刷新

     1 int count = 0;
     2 int success_count = 0;
     3 foreach (string gen in fn_gen)
     4 {
     5     //MessageBox.Show(gen);
     6     Bitmap Bi = new Bitmap(gen);  //使用打开的图片路径创建位图对像
     7     Image Image = Bi;
     8     if (Image.Width >= 170 && Image.Height >= 200)
     9     { 
    10         string destinationFile = result + gen.Substring(gen.LastIndexOf(@""), gen.Length - gen.LastIndexOf(@""));
    11         bool isrewrite = true; // true=覆盖已存在的同名文件,false则反之
    12         System.IO.File.Copy(gen, destinationFile, isrewrite);
    13         success_count++;
    14         this.Txt_Count.Refresh();
    15         this.Txt_Count.Text = success_count.ToString() + "/" + count.ToString();
    16         Application.DoEvents();// Application.DoEvents()的作用:处理所有的当前在消息队列中的Windows消息。
    17         System.Threading.Thread.Sleep(100);
    18     }
    19     count++;
    20     Bi = null;
    21     System.GC.Collect();
    22 }
  • 相关阅读:
    Docker系列二:Docker的基本结构
    Codeforces 1013
    树形结构升级
    Codeforces 402 and 403 (Div. 2 and 1)
    Codeforces 342
    图论基础
    树形结构基础
    Codeforces 788 (Div. 1)
    NOIP/CSP-J/S初赛集锦
    树的重心
  • 原文地址:https://www.cnblogs.com/pkjplayer/p/6692901.html
Copyright © 2011-2022 走看看