using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using SnowLight; namespace SnowLightV3.Forms { public partial class AutoPower_Off : Form { public AutoPower_Off() { InitializeComponent(); } private void AutoPower_Off_Load(object sender, EventArgs e) { button2.Visible = false; } private void timer1_Tick(object sender, EventArgs e) { DateTime h = DateTime.Now; if (textBox1.Text == h.Hour.ToString() && textBox2.Text == h.Minute.ToString()) { timer4.Enabled = true; timer2.Enabled = true; timer5.Enabled = false; } } private void timer2_Tick(object sender, EventArgs e) { try { // Console.Beep(); button2.Visible = true; Program.Stop(); Environment.Exit(0); timer2.Interval = 2000; } finally { timer2.Interval = 2000; } } private void timer3_Tick(object sender, EventArgs e) { DateTime h = DateTime.Now; label2.Text = ("Hora: " + h.Hour + " Minuto: " + h.Minute + " Segundo: " + h.Second); } private void button2_Click(object sender, EventArgs e) { DateTime h = DateTime.Now; textBox1.Text = h.Hour.ToString(); timer1.Enabled = false; button2.Visible = false; button1.Visible = true; timer2.Enabled = false; timer4.Enabled = false; } private void timer4_Tick(object sender, EventArgs e) { } private void timer5_Tick(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { button1.Visible = false; button2.Visible = true; timer1.Enabled = true; timer5.Enabled = true; } } }