This one is not so obvious. I was curious one day after using several utilities that wrote a percent complete to the command line. I had never done this in C# so I went searching. Here it is:
using System;using System.Collections.Generic;using System.Threading;public class MyClass{ public static void Main() { for(int i = 0; i < 100;i++) { Console.Write("{0}% Complete\r", i); Thread.Sleep(100); } }}
Running this code will produce an output like this:
Trick originally came from here:
http://www.dotnet247.com/247reference/msgs/6/31315.aspx