public void readFiles()
{
// Sets the progress bar's minimum value to a number
// representing the hard disk space before the files are read in.
// You will most likely have to set this using a system call.
// NOTE: The code below is meant to be an example and
// will not compile.
progressBar1.Minimum = AvailableDiskSpace();
// Sets the progress bar's maximum value to a number
// representing the total hard disk space.
// You will most likely have to set this using a system call.
// NOTE: The code below is meant to be an example
// and will not compile.
progressBar1.Maximum = TotalDiskSpace();
// Uses a for loop to iterate through the operations to be
// completed. In this case, five files are to be written
// to the disk, so it will execute the loop 5 times.
for (int i = 1; i<= 5; i++)
{
// Insert code to read a file into memory and update file size.
// Increases the progress bar's value based on the size of
// the file currently being written.
progressBar1.Increment(FileSize);
// Updates the label to show available drive space.
label1.Text = "Current Disk Space Used = " + progressBar1.Value.ToString();
}
}