C#有一个更高级的控制台库吗?

[英]Is there a fancier Console library for C#?


Is there any library for .NET which can:

是否有任何.NET库可以:

  • output characters/words in color
  • 输出颜色的字符/单词
  • draw stuff in console like progress bars (similar to wget)
  • 在控制台中绘制内容,如进度条(类似于wget)
  • other funny beautiful things i might consider using in my glamor console app
  • 我可能会考虑在我的魅力控制台应用中使用其他有趣的美丽事物

3 个解决方案

#1


21  

Yes; the Console class can do all of that.

是; Console类可以完成所有这些。

#2


21  

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).

很久以前由Microsoft的Tim Sneath编写的ConsoleEx库可以进行一些高级着色和写作。它通常比控制台好很多,甚至是.NET 4.0控制台(据我所知)。

And it's on NuGet!

它在NuGet上!

#3


1  

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.

我在进度指标方面取得了一些成功。该块从事件中调用,可以从多个线程调用。它显示1%并在一行上适当增加。

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() + "%");
    }
}

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2011/04/28/1881ea8782920e26784f52d8da08c586.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号