I'm pretty sure i can figure out how to make use of the progress bar itself but its getting to the point of using it that becomes a problem. I am a nOOb programmer so please bear with me. I've created a simple program to copy a file from one location to another. I am trying to impliment a progress bar to show how far along the task is. I'm pretty familiar with the basic functions of the progress bar itself as I have been able to get it to auto increment itself. I'm just not sure how to get information about the copy progress. Heres a snippet of my code if someone can please give me a pointer.
Question
rafter109
I'm pretty sure i can figure out how to make use of the progress bar itself but its getting to the point of using it that becomes a problem. I am a nOOb programmer so please bear with me. I've created a simple program to copy a file from one location to another. I am trying to impliment a progress bar to show how far along the task is. I'm pretty familiar with the basic functions of the progress bar itself as I have been able to get it to auto increment itself. I'm just not sure how to get information about the copy progress. Heres a snippet of my code if someone can please give me a pointer.
private void backupButton_Click(object sender, System.EventArgs e)
{
string sourceFile = System.Configuration.ConfigurationSettings.AppSettings
["sourceFileKey"];
string destinationFile = System.Configuration.ConfigurationSettings.AppSettings
["destinationFileKey"];
if (File.Exists( destinationFile ))
{
File.Delete( destinationFile );
}
File.Copy( sourceFile, destinationFile);
}
Thank you all in advance
Link to comment
Share on other sites
18 answers to this question
Recommended Posts