Results 1 to 5 of 5

Thread: [VB6] Last Seen Feature

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2018
    Posts
    23

    Lightbulb [VB6] Last Seen Feature

    Hello
    Code:
    Private Sub Timer1_Timer() 
      ' This will save last seen for your user
      ' Dim x, y in General
      ' Timer1.Interval = 777
      x = Format$(Now, "Short Time")
      y = Format$(Now. "Short Date")
      Open "C:\MyLastSeen.dat" For Output As 1
      Write #1, x, y
      Close
    End Sub
    Private Sub Timer2_Timer() 
       ' This will load someone's last seen
       ' Dim xx, yy, zz in General
       ' Timer2.Interval = 777
       On Error Resume Next
       Open "c:\User1.dat" For Input As 1
       Input #1, xx, yy
       Close
       zz = DateDiff ("d", yy, Date)
       if zz = 0 Then
         Label1.Caption = "Last Seen Today at " & xx
       ElseIf zz = 1 Then
         Label1.Caption = "Last Seen Yesterday at " & xx
       ElseIf zz > 1 Then
         Label1.Caption = "Last Seen at " & xx & " on Date " & yy
       End if
    End Sub
    Last edited by Eng27; Feb 19th, 2019 at 10:38 AM. Reason: Added CODE tags

Tags for this Thread

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