Option Explicit
Private Inicio As Single, Dif As Single, Total As Single
Dim segun As Integer
Dim minu As Integer
Dim hor As Integer
Dim resumen As String
Private Sub Command1_Click()
Dim Total
Open "C:\Total.txt" For Output Shared As #1
Write #1, Dif
Close #1
Unload Me
End Sub
Private Sub Form_Load()
If (Dir("C:\Total.txt") <> "") Then
Exit Sub
Else
Open "C:\Total.txt" For Output Shared As #1
Write #1, 60 'Aqui pones la cantidad de tiempo en segundos que deseas que la aplicación trabaje
Close #1
End If
Open "C:\Inicio.txt" For Output Shared As #1
Write #1, Timer
Close #1
End Sub
Private Sub Timer1_Timer()
Static contador As Integer
contador = contador + 1
segun = segun + 1
If segun = 60 Then
minu = minu + 1
segun = 0
End If
If minu = 60 Then
hor = hor + 1
minu = 0
End If
resumen = Format(hor, "00") & ":" & Format(minu, "00") & ":" & Format(segun, "00")
Etiqueta1.Caption = resumen
Open "C:\Inicio.txt" For Input As #1
Input #1, Inicio
Close #1
Open "C:\Total.txt" For Input As #1
Input #1, Total
Close #1
Dif = Total - segun
Debug.Print Dif
Open "C:\Dif.txt" For Output Shared As #1
Write #1, Dif
Close #1
If Dif = 0 Then
MsgBox "Se acabo tu Tiempo", vbCritical, "Time Out"
Unload Me
Else
Exit Sub
End If
End Sub
Se que no es el mejor pero PINCHA...
Haber si alguien se embulla y me ayuda a guardar los tiempos en ves de TXT en el Registro... Salu2...
Posteenn