October 9th, 2002, 12:46 AM
Timing... plz help?
k i have a webserver set up right now and i was wondering if it would be possibleto make a program that runs at the bottom of the sceen just minimized that will for example close the server at 4:30 am, then restart it at 4:33 am, there are paths for the webserver that start it and stop it :
start : c:/phpdev/phpdev_start.bat
stop : c:/phpdev/phpdev_stop.bat
is there a way to set it up so it runs by the system clock or somehting?
October 9th, 2002, 01:25 AM
To start and stop the application you could use the shell function. The Application could always be in the Taskbar by setting WindowsState to vbminimized and handling the resize event of the form and set there the windowstate to vbminimized.
I dont know how to do the things to specific times.
Hope I could help you.
Music, music and VB. VB is like music: You never know how it is interpreted.
October 9th, 2002, 05:16 AM
If Time = #4:30:00 AM# Then
October 9th, 2002, 08:55 AM
The example from Kangolian will work except the CPU usage will go up to 100% (and yes it does not cause the system to hang as the DOEVENTS takes care of that).
Another way is to use TIMER control and set it to go off every minute and check the time when the timer triggers and execute your logic accordingly.
October 9th, 2002, 09:00 AM
And do not use that kind of IF:
Use something more like:
If TimeNow = TimeToStart Then
You want it to start event if there is some seconds in more. In that case, you must make sure that the server is not started before starting it, because the condition will be always true
If TimeNow >= TimeToStart Then
Click Here to Expand Forum to Full Width