Is there any library for .NET which can:
Yes; the Console
class can do all of that.
Console.ForegroundColor
CursorLeft
and CursorTop
The ConsoleEx library, written a long time ago by Microsoftie, Tim Sneath, can do some advanced coloring and writing to positions. It's generally a lot better than the Console, even the .NET 4.0 Console (as far as I can tell).
And it's on NuGet!
I have had a bit of success with a progress indicator. This block is called from an event and may be called from multiple threads. it displays 1% and increments as appropriate on one line.
private object thislock = new Object();
void UpdateProgress(DownloadProgressChangedEventArgs e)
{
lock (thislock)
{
for (int i = 0; i < 50; i++)
{
Console.Write("\b");
}
Console.Write(e.ProgressPercentage.ToString() + "%");
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With