using System;
using System.Text;
using System.Threading;
namespace csharp.Example.System
{
class ConsoleProgressBar
{
//[STAThread]
public static void Main(string[] args)
{
StringBuilder progress = new StringBuilder();
for (int i = 1; i <= 100; i++)
{
// Increments progress bar indicator.
//
if (i % 2 == 0)
{
progress.Append("=");
}
//
// Prints the progress bar and return to the beginning of
// the line using carriage return (\r). Using carriege
// return makes the next print process occurs in the same
// line of the console.
//
Console.Write(i + "% " + progress.ToString() + "\r");
// Adds delay to simulate a process.
Thread.Sleep(100);
}
Console.Write("Done! ");
Console.Read();
}
}
}
Be Different with excellent knowledge A Devloper Blog....
Subscribe to:
Post Comments (Atom)
AngularJS Basics - Part 1
AngularJS What is AngularJS · Framework by googl...
-
Make Your Own Notepad In this tutorial we will be making a simple C# Notepad with the option to Clear, Cut, Copy, Paste, Select All, Save...
-
What is View? A simple view can be thought of as a subset of a table. It can be used for retrieving data, as well as updating or deleting r...
No comments:
Post a Comment
Your comment is pending for approval