Salve, sto sviluppando un piccolo software come esercizio che dovrebbe permettere all'utente di spegnere il pc fra quanto tempo volgiono. Ho scritto questo
Ma pare ci siano problemi con & num & mi da un errore riguardante CastException o roba simile, sapresti aiutaremi ?codice:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim num As Integer num = TextBox1.Text If Me.CheckBox1.Checked = True Then Shell("shutdown -s -t -f", "& num &") End If End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick End Sub End Class

Rispondi quotando
