[ bolepks @ 06.11.2012. 11:20 ] @
Napravio sam timer za gašenje PC sve funkcioniše, osim kada kliknem i treba da se ugase on potpuno ne ugasi računar već se čuju ventilatori, u čemu je problem? Evo koda Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Label1.Text = Format(TimeOfDay) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer2.Enabled = True TextBox1.Enabled = False Button2.Enabled = True Button1.Enabled = False End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer2.Enabled = False TextBox1.Text = "00:00:00" TextBox1.Enabled = True Button1.Enabled = True Button2.Enabled = False End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick If TextBox1.Text = Label1.Text Then Shell("shutdown -s") End If End Sub End Class |