2017-05-09

Progress Bar in Console


There is a working spinner example posted in stackoverflow as:
 public class ConsoleSpiner
    {
        int counter;
        public ConsoleSpiner()
        {
            counter = 0;
        }
        public void Turn()
        {
            counter++;
            switch (counter % 4)
            {
                case 0: Console.Write("/"); break;
                case 1: Console.Write("-"); break;
                case 2: Console.Write("\\"); break;
                case 3: Console.Write("-"); break;
            }
            Console.SetCursorPosition((Console.CursorLeft - 1), Console.CursorTop);
        }
    }


#####
ConsoleSpiner spin = new ConsoleSpiner();
 Console.Write("Working….");
while (true)
      {
         spin.Turn();
     }


##########
What I really looking for is the progress bar showing percentage.


Wait for it......

No comments:

Post a Comment

Setup VNC on Ubuntu 20.04

  sudo apt update sudo apt install xfce4 xfce4-goodies sudo apt install tigervnc-standalone-server sudo apt install tightvncserver vncserver...