-
October 9th, 2002, 12:46 AM
#1
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?
plz help
thanks
-
October 9th, 2002, 01:25 AM
#2
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.
mfg Ungi
Music, music and VB. VB is like music: You never know how it is interpreted.
-
October 9th, 2002, 05:16 AM
#3
time
Do
If Time = #4:30:00 AM# Then
Shell "c:/phpdev/phpdev_start.bat"
End If
DoEvents
Loop
-
October 9th, 2002, 08:55 AM
#4
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.
-Cool Bizs
-
October 9th, 2002, 09:00 AM
#5
And do not use that kind of IF:
Code:
If TimeNow = TimeToStart Then
Use something more like:
Code:
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
JeffB
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|