Insane Killa
Dec 1st, 1999, 08:52 PM
Ok on an app I am workin on at the moment I have it detecting whether the user is connected to the internet or not but if it finds the connection I want it to start timing the time spent online to a label
also I want it to detect if someone is dialing up and then start timing from there.
If anyone can help I would muchly appreciate it.
thanx
DiGiTaIErRoR
Dec 1st, 1999, 09:19 PM
you could time it by using the existing date and time and the one set at dial-up then subtract the current from the old you'll probably have a lot of IF's but it'ld work
just use Left$ Mid$ and Right$ to get each section hour min sec etc.
Hope this helps!
------------------
DiGiTaIErRoR
Insane Killa
Dec 2nd, 1999, 10:23 AM
Can U Give Me An Example Code?
DiGiTaIErRoR
Dec 2nd, 1999, 08:42 PM
Private Sub Form_Load()
Label1.Caption = Time$
label2.Caption = Time$
End Sub
Private Sub Timer1_Timer()
label2.Caption = Time$
End Sub
Private Sub label2_Change()
Dim Secs As Integer
Dim Mins As Integer
Dim Hours As Integer
Secs = Right(label2.Caption, 2) - Right(Label1.Caption, 2)
If Secs < 0 Then Secs = 60 - Right(Label1.Caption, 2) + Right(label2.Caption, 2)
If Right(label2.Caption, 2) >= Right(Label1.Caption, 2) Then Mins = Val(Mid$(label2.Caption, 4, 2)) - Val(Mid$(Label1.Caption, 4, 2))
If Mins < 0 Then Mins = 60 - Val(Mid$(Label1.Caption, 4, 2)) + Val(Mid$(label2.Caption, 4, 2))
Hours = Left(label2.Caption, 2) - Left(Label1.Caption, 2)
Text1.Text = Hours & ":" & Mins & ":" & Secs
Secs = "0"
End Sub
This pretty much does it you'll need 2 labels 1 timer 1 textbox
[This message has been edited by DiGiTaIErRoR (edited 12-03-1999).]