1.关于ProgressBar(或toolprogressbar)的用法:
    要使用ProgressBar进度条显示File.Copy(sourcefile,desfile,true)这个命令的进度要怎么做???2.有一文件是经过编码的,大概有5G的内容,我想打开读取显示的是16进制格式的要怎么做?(就好像用Uedi32打开的那样)3.网页:
   在服务器端拷文件(不是下载),在客户的浏览器里面怎么显示进度(百分比)?

解决方案 »

  1.   

    进度条有专门的示例:MSDN 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();
    }
    }
    }
      

  2.   

    用File.copy 估计实现不了了拷贝进度,要么自己实现 stream 拷贝,这样根据总的文件大小和已经拷贝过的文件大小,能计算出进度了