06/01/10 19:59
visualrenzo
qualcuno sa dirmi perchè non mi funziona la parte della label ovvero ha funzionato per qualche volta poi non vedo mai i messaggi delle select case la il file lo scarica correttamente.
Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error GoTo errore
Select Case State
Case 0
labelStato = "*******"
Case 1
labelStato = "Controllo host"
Case 2
labelStato = " Controllo Host OK"
Case 3
labelStato = "Connessione in corso..."
Case 4
labelStato = "Connesso"
Case 5
labelStato = "Richiesta..."
Case 6
labelStato = "Attendere..."
Case 7
labelStato = "Connessione..."
Case 8
labelStato = "Risposta ricevuta, attendere.."
Case 9
labelStato = "Disconnessione in corso.."
Case 10
labelStato = "Disconnesso"
Case 11
labelStato = "Errore"
Case 12
labelStato = "Concluso"
End Select
Exit Sub
errore:
labelStato.Caption = Err.Description
Resume Next
End Sub
Private Sub bottonScarica_Click()
Dim stringSourceFile As String, stringDestinationFile As String
stringSourceFile = "estrazionidellotto.com/…;
stringDestinationFile = ("C:\Enalotto.exe"
Dim bytInputData() As Byte
Dim IntNumberFile As Integer
bytInputData() = Inet1.OpenURL(stringSourceFile, icByteArray)
IntNumberFile = FreeFile
Open stringDestinationFile For Binary As #IntNumberFile
Put #IntNumberFile, , bytInputData()
Close #IntNumberFile
'MsgBox "File scaricato e salvato correttamente", vbDefaultButton1
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error GoTo errore
Select Case State
Case 0
labelStato = "*******"
Case 1
labelStato = "Controllo host"
Case 2
labelStato = " Controllo Host OK"
Case 3
labelStato = "Connessione in corso..."
Case 4
labelStato = "Connesso"
Case 5
labelStato = "Richiesta..."
Case 6
labelStato = "Attendere..."
Case 7
labelStato = "Connessione..."
Case 8
labelStato = "Risposta ricevuta, attendere.."
Case 9
labelStato = "Disconnessione in corso.."
Case 10
labelStato = "Disconnesso"
Case 11
labelStato = "Errore"
Case 12
labelStato = "Concluso"
End Select
Exit Sub
errore:
labelStato.Caption = Err.Description
Resume Next
End Sub
Private Sub bottonScarica_Click()
Dim stringSourceFile As String, stringDestinationFile As String
stringSourceFile = "estrazionidellotto.com/…;
stringDestinationFile = ("C:\Enalotto.exe"
Dim bytInputData() As Byte
Dim IntNumberFile As Integer
bytInputData() = Inet1.OpenURL(stringSourceFile, icByteArray)
IntNumberFile = FreeFile
Open stringDestinationFile For Binary As #IntNumberFile
Put #IntNumberFile, , bytInputData()
Close #IntNumberFile
'MsgBox "File scaricato e salvato correttamente", vbDefaultButton1
End Sub
aaa