We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this questionIs there any library for .NET which can:
- output characters/words in color
- draw stuff in console like progress bars (similar to wget)
- other funny beautiful things i might consider using in my glamor console app
Yes; the Console
class can do all of that.
- Set
Console.ForegroundColor
- Print Unicode Box Drawing Characters and set
CursorLeft
andCursorTop
- Such as?
ConsoleEx
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() + "%");
}
}
精彩评论