اول این رو به کد های برنامه اضافه کن
public void Copyfile(string sourceFileName, string targetFileName, ProgressBar progress)
{
progress.Value = 0;
System.IO.FileStream S_file = new System.IO.FileStream(sourceFileName, System.IO.FileMode.Open);
System.IO.FileStream D_file = new System.IO.FileStream(targetFileName, System.IO.FileMode.Create);
Int64 len = S_file.Length ;
for (Int64 i = 0; i < len; i++)
{
D_file.WriteByte((byte)S_file.ReadByte());
if (i % 1000 == 0)
{
progress.Value = (int)(i * 100 / len)+1;
Application.DoEvents();
}
}
S_file.Close();
D_file.Close();
progress.Value = 100;
}
بعد در کد کلیک بنویس
Copyfile(@"D:\test.pdf", @"D:\test_2.pdf", progressBar1);