Aplicacion Expira en 30 dias

Iniciado por CsarGR, 23 Abril 2007, 10:27 AM

0 Miembros y 2 Visitantes están viendo este tema.

~~

Para q cntinue por donde iba guarda ese dato en el registro o en algun archivo... claro q una vez se conozca el metodo q usa sera bastante facil usar el programa eternamente

soru13

tengo un pekeño problema con el code, cuando ago que carge el tiempo guardado del archivo de texto a un text box me carga el numero y luego 2 rallas y por esas 2 rallas no me carga bien el numero , aver si alguien me puede decir porque sale, dejo aqui todo el codigo k tengo echo y la imagen



CitarPrivate Sub savetext1()
Dim canalLibre As Integer
canalLibre = FreeFile
Open "./tiempo.txt" For Output As #canalLibre
Print #canalLibre, Text1
Close #canalLibre
End Sub

Private Sub savetext2()
Dim canalLibre As Integer
canalLibre = FreeFile
Open "./tiempo2.txt" For Output As #canalLibre
Print #canalLibre, Text2
Close #canalLibre
End Sub

Private Sub savetext3()
Dim canalLibre As Integer
canalLibre = FreeFile
Open "./tiempo3.txt" For Output As #canalLibre
Print #canalLibre, Text3
Close #canalLibre
End Sub

Private Sub Form_Load()
Label1.Caption = Text4.Text
Label2.Caption = Text5.Text
Label3.Caption = Text6.Text
cargartxt1
cargartxt2
cargartxt3
Timer1.Enabled = True
Timer2.Enabled = True
End Sub

Private Sub cargartxt1()
On Error Resume Next
Dim n_File As Integer
Dim Contenido As String
    n_File = FreeFile
    Open "./tiempo.txt" For Input As n_File
    Contenido = Input$(LOF(n_File), #n_File)
    Close n_File
    Text4 = Contenido
End Sub

Private Sub cargartxt2()
On Error Resume Next
Dim n_File As Integer
Dim Contenido As String
    n_File = FreeFile
    Open "./tiempo2.txt" For Input As n_File
    Contenido = Input$(LOF(n_File), #n_File)
    Close n_File
    Text5 = Contenido
End Sub

Private Sub cargartxt3()
On Error Resume Next
Dim n_File As Integer
Dim Contenido As String
    n_File = FreeFile
    Open "./tiempo3.txt" For Input As n_File
    Contenido = Input$(LOF(n_File), #n_File)
    Close n_File
    Text6 = Contenido
End Sub

Private Sub Timer1_Timer()
Label6.Caption = "0"
Label3.Caption = Val(Label3.Caption) + 1
If Val(Label3.Caption) < 10 Then
    Label3.Caption = "0" & Label3.Caption
End If
    If Val(Label3.Caption) > 59 Then
        Label3.Caption = "00"
        Label2.Caption = Val(Label2.Caption) + 1
            If Val(Label2.Caption) < 10 Then
                Label2.Caption = "0" & Label2.Caption
            End If
        If Val(Label2.Caption) > 59 Then
            Label2.Caption = "00"
            Label1.Caption = Val(Label1.Caption) + 1
           
            If Val(Label1.Caption) < 10 Then
                Label1.Caption = "0" & Label1.Caption
            End If
        End If
    End If
End Sub

Private Sub Timer2_Timer()
Label6.Caption = Val(Label6.Caption) + 1
End Sub

Private Sub Timer3_Timer()
savetext1
savetext2
savetext3
End Sub

Private Sub Timer4_Timer()
Text1.Text = Label1.Caption
Text2.Text = Label2.Caption
Text3.Text = Label3.Caption
End Sub


~~

En un archivo de texto el caracter de salto de linea se representa con esas dos ralla.
Para ahorrarte código lo mejor q puedes hacer es abrir el archivo de text oal inicio del programa leerlo TODO y luego partirlo con un split por el "||" o usando vbcrlf, q es lo mismo  :P

soru13

ya lo arregle, puse el textbox en multiline y ya sta:

ya e acabado el cronometro, guarda bien el tiempo, luego lo carga y lo reanuda por donde iva, ahora lo tengo que acoplar a la aplicacion

~~

Te recomiendo q hagas q guarde el timpo cada 5min por ejemplo, por q si te cierran el programa con el task por ejemplo no ejecutará el form unload

soru13

es lo que he hecho, bueno ya he acabado el programa y funciona perfectamente, el serial se modifica desde el codigo fuente y se puede poner varios, aqui os dejo el source

http://sorucreations.gratishost.com/

http://sorucreations.gratishost.com/

http://sorucreations.gratishost.com/

http://sorucreations.gratishost.com/