NETLearn AJAXLearn Silverlight Learn Visual Studio Learn ADO. NETLearn Web Services Learn Controls Learn Biz Talk Learn Share Point Learn Mobile Learn SQLLearn SQL Reporting Learn Windows Forms Learn XMLLearn Crystal Reports Learn Far Point Learn Dev Express Examples ASP.
We cover these topics on this entry of the Programming Underground! You try to code your program due at 4pm and it is taking forever to process this simple text file. If only you had thrown in that progress bar so you can get an idea how much longer it will take! The program below is pretty simple if you follow the line of execution here, which splits into two threads. This is where you always start out in the program and this is where your forms and controls live. When this thread reaches the end, so does your program. Thread Start theprogress = new Thread Start(Read File); // Now the thread which we create using the delegate Thread startprogress = new Thread(theprogress); // We can give it a name (optional) startprogress.
C# is processing slower than molasses and you don’t even know where in the processing it is at. After all, you have Capty’s birthday to get too and you don’t want to miss him in his drunkin speedo wearin debut. But you can create other threads of execution that run along side your programs execution. Name = "Update Progress Bar"; // Start the execution startprogress.
If you have a file with tens or hundreds of thousands of lines, or datasets which may have millions of records, it is going to take some time to process.
It is fine that it takes a bit of time, it is understandable, but how about showing the user the progress WITHOUT tying up their user interface (so they can do other things)?