Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 System.Diagnostics;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- String shutdown;
- private void button1_Click(object sender, EventArgs e)
- {
- Process.Start("Shutdown", shutdown + "-t" + textBox1.Text + @"-c""Windows fährt in kürze herunter""");
- timer1.Start(); label3.Text = textBox1.Text;
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Process.Start("Shutdown", "-a"); timer1.Stop();
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- switch (comboBox1.SelectedIndex);
- {
- case0 shutdown = "-s";
- case1 shutdown = "-r";
- case2 shutdown = "-l";
- }
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- label3.Text = (Convert.ToInt32(label3.Text) - 1).ToString;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement