i want to display the current progress..
So, In the first line it should display the current file Name
second line to display the current file No.
third should display completed %
So i made this little program
string[] files = Directory.GetFiles(sourceDirectory, "*", SearchOption.AllDirectories);
int totalfiles = Directory.GetFiles(sourceDirectory, "*.*", SearchOption.AllDirectories).Length;
Console.WriteLine("{0} File(s) Found.", totalfiles);
int num = 1;
double percent = 0.0;
foreach (string file in files)
{
Console.Write("\rCurrent File Name :- {0}",Path.GetFileName(file));
percent = Convert.ToInt32(((double)num / (double)totalfiles) * (double)100);
Console.Write("\r{0}/{1} Files Completed", num++, totalfiles);
Console.Write("\r{0}% Completed", (num / totalfiles) * 100);
Thread.Sleep(10);
}
But This is not displaying it correctly as i wanted
SeeThisOutputImage
it if overlapping everyline..
i know that i am not writing "\n" or "WriteLine" as this will generate the new line every time
so what should i do??
Please Help
Sorry for my bad English and also sorry if the question title is not correct..