计算出总共要备份的文件数目,然后没备份一段时间计算剩余数目,做个百分比来控制进度,不知道.net里这样做可行不……一点儿个人想法

解决方案 »

  1.   

    如果想那么做的话,只能自己用sql语句来备份,然后用进度条来显示当前进度!
      

  2.   

    你参考一下我在这个帖子中的答复.在winform中,如何取得数据读取进度!
    http://expert.csdn.net/Expert/TopicView3.asp?id=1311170
      

  3.   

    backup的时候能得到输出信息吧
    那就自己根据数据库的大小进行判断
      

  4.   

    private void CopyWithProgress(string[] filenames)
          {
             // Display the ProgressBar control.
             pBar1.Visible = true;
             // Set Minimum to 1 to represent the first file being copied.
             pBar1.Minimum = 1;
             // Set Maximum to the total number of files to copy.
             pBar1.Maximum = filenames.Length;
             // Set the initial value of the ProgressBar.
             pBar1.Value = 1;
             // Set the Step property to a value of 1 to represent each file being copied.
             pBar1.Step = 1;
             
             // Loop through all files to copy.
             for (int x = 1; x <= filenames.Length; x++)
             {
                // Copy the file and increment the ProgressBar if successful.
                if(CopyFile(filenames[x-1]) == true)
                {
                   // Perform the increment on the ProgressBar.
                   pBar1.PerformStep();
                }
             }
          }
    你要得到最大时间!
      

  5.   

    通过调用进程API好象可以取得进程运行的时间。