- 9 Aprile 2012
- 553
- 0
- Miglior risposta
- 0
Giorno, perfavore io ho un problema con il mio "chiudi pc automatico", serve a impostare un timer ed entro quel tempo prestabilito il pc si spegnerà ecco la source :
Allora vi spiego i problemi !
1) Il count parte dale 10:24 cioè l'orario di ora forse per il : TimeOfDay (non so con cosa sostiturie)
2) Non fa il countdown ma il contrario cioè (es. 1,2,3)
Dove sbaglio?
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = TimeOfDay
If Label1.Text = "( 00:00:00 )" Then
Shell("shutdown -s")
End If
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
End Class
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = TimeOfDay
If Label1.Text = "( 00:00:00 )" Then
Shell("shutdown -s")
End If
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
End Class
Allora vi spiego i problemi !
1) Il count parte dale 10:24 cioè l'orario di ora forse per il : TimeOfDay (non so con cosa sostiturie)
2) Non fa il countdown ma il contrario cioè (es. 1,2,3)
Dove sbaglio?