ایجاد یک نوار پیشرفت (progress bar) در محیط کنسول
برای ایجاد یک نوار پیشرفت (progress bar) در محیط کنسول می توانید به صورت زیر عمل کنید :
using System; using System.Text; using System.Threading; namespace www.w3farsi.com { 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 % 10 == 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! "); } } }
عالی☺☺
با سلام و احترام
اگه امکان داره مثالها رو در محیط windows application آموزش بدین
خیلی ممنون از آموزش شما
به روی چشم دوست عزیز حتما اینکارو در آینده انجام میدیم
مرسی از نظرتون
راستش من الان نسخه ده رو استفاده می کنم ولی نسخه 11 هم اومده که واقعا کامپوننت های زیبای جدیدی بهش اضافه شده .
نسخه ای که من استفاده میکنم همانطور که گفتم 10 هست و بهمراهش یک Patch داره که به اصطلاح کرکش می کنه