| | |
Help with Logic
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2008
Posts: 99
Reputation:
Solved Threads: 1
I need my program to "stop" as the timer is running and when the timer returns true i need it to continue what it was doing.
Sleep:
example of the posting
Sleep:
C# Syntax (Toggle Plain Text)
void iUpdateStatus() { bComplete = true; //IDC_Status.Text = IDC_Status.Text + "\r\n" + DateTime.Now.ToString(); } bool sSleep() { System.Timers.Timer myTimer = new System.Timers.Timer(); myTimer.Elapsed += new ElapsedEventHandler(DisplayTimeEvent); myTimer.Interval = 15000; myTimer.Start(); if (bComplete) { bComplete = false; myTimer.Stop(); return true; } return false; } void DisplayTimeEvent(object source, ElapsedEventArgs e) { if(IDC_Status.InvokeRequired) { IDC_Status.Invoke(new MethodInvoker(iUpdateStatus)); } }
example of the posting
C# Syntax (Toggle Plain Text)
LoadText(Zone); PostTopic(3, "[RS.com] Zone Alarm Keygen", Post); //Sleep Here once timer has completed go to next lot LoadText(Adobe); PostTopic(3, "[RS.com] All Adobe Keygens", Post); //Sleep Here once timer has completed go to next lot LoadText(Alcohol); PostTopic(3, "[RS.com] Alcohol 120% v1.9", Post); //Sleep Here once timer has completed go to next lot LoadText(CleanMyPC); PostTopic(3, "[RS.com] CleanMyPC", Post); //Sleep Here once timer has completed go to next lot LoadText(DVDFab); PostTopic(3, "[RS.com] DVDFab 5.1 Final", Post); //Sleep Here once timer has completed go to next lot
•
•
Join Date: Jul 2008
Posts: 49
Reputation:
Solved Threads: 7
Simply put your current thread in sleep mode. Fairly easy to do with 1 line of code.
C# Syntax (Toggle Plain Text)
System.Threading.Thread.Sleep(int milliseconds);
•
•
Join Date: May 2008
Posts: 99
Reputation:
Solved Threads: 1
•
•
•
•
Simply put your current thread in sleep mode. Fairly easy to do with 1 line of code.
C# Syntax (Toggle Plain Text)
System.Threading.Thread.Sleep(int milliseconds);
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
If you have something that needs to pause and continue you shouldnt be using the mainthread for it. Thats what threads were invented for.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
![]() |
Similar Threads
- Prog and Logic Question for beginner (Legacy and Other Languages)
- Calculator Logic (VB.NET)
- programming logic test (ASP.NET)
- Can't get rid of URL Logic Pop up generator (Viruses, Spyware and other Nasties)
- Logic to Convert Days From 1800 to a Date (Month, Day, Year) (C++)
- Got Fractions? Method help w/ logic issue (Java)
- IF-Then Logic (Java)
Other Threads in the C# Forum
- Previous Thread: Reading from pdf
- Next Thread: Sleeping without pausing the main thread
| Thread Tools | Search this Thread |
.net access activedirectory ado.net algorithm array barchart bitmap box broadcast c# check checkbox client combobox contorl control conversion csharp custom database datagrid datagridview dataset datetime degrees deployment development disabled displayingopenforms draganddrop drawing editing editor encryption enum event excel file form format forms ftp function gdi+ httpwebrequest i18n image imageprocessing index index-error input install java label list listbox mandelbrot math mathematics mouseclick mysql operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remoting richtextbox rows server setup sleep socket sql statistics stream string table text textbox thread time timer update user usercontrol validation visualstudio webbrowser windows winforms wpf xml






