Programma che permettere di spegnere, riavviare e disconnettere il computer, facile e semplice da creare con solo poche righe di codice
codice:
Private Sub Command1_Click()
Select Case Option1.CausesValidation And Option2.CausesValidation And Option3.CausesValidation
Case Option1.Value = True And Option2.Value = False And Option3.Value = False
Riavvia
Case Option1.Value = False And Option2.Value = True And Option3.Value = False
Spegni
Case Option1.Value = False And Option2.Value = False And Option3.Value = True
Disconnetti
End Select
End Sub
ora negli optionbutton inserite un codice per ognuno a seconda il compito che deve eseguire il nostro programma
Private Sub Riavvia()
Shell ("shutdown -r -t 00") 'questo serve per riavviare il pc
End Sub
Private Sub Spegni()
Shell ("shutdown -s -t 00") 'questo per spegnere
End Sub
Private Sub Disconnetti()
Shell ("shutdown -l -t 00") 'questo per disconnettere
End Sub
rinominate gli optionbutton in "spegni" "riavvia" "disconnetti"
Link to this comment:
Video Responses
All Comments (0)