Results 1 to 2 of 2

Thread: Timing Connection

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    65

    Post

    I've asked this question before, but no answer has ever worked to successfully.

    I have my app checking to see if there is an internet connection, but I want it to start timing the connection on a label if it finds a connection.

    Can someone help.

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    make a timer set the interval to 500 (timer1)
    make a textbox (text1)
    make a label equal to the time they logged on (label1)
    Code:
    Private Sub Timer1_Timer()
    Dim Secs As Integer
    Dim Mins As Integer
    Dim Hours As Integer
        Secs = Right(Time$, 2) - Right(Label1.Caption, 2)
            If Secs < 0 Then Secs = 60 - Right(Label1.Caption, 2) + Right(Time$, 2)
    If Right(Time$, 2) >= Right(Label1.Caption, 2) Then Mins = Val(Mid$(Time$, 4, 2)) - Val(Mid$(Label1.Caption, 4, 2))
            If Mins < 0 Then Mins = 60 - Val(Mid$(Label1.Caption, 4, 2)) + Val(Mid$(Time$, 4, 2))
        Hours = Left(Time$, 2) - Left(Label1.Caption, 2)
    Text1.Text = Hours & ":" & Mins & ":" & Secs
    End Sub
    it checks label1 against the current time
    and displays the difference (duration) in text1.text if you don't get it ur dumb

    ------------------
    DiGiTaIErRoR

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width