Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Diagnostics;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19. String shutdown;
  20. private void button1_Click(object sender, EventArgs e)
  21. {
  22. Process.Start("Shutdown", shutdown + "-t" + textBox1.Text + @"-c""Windows fährt in kürze herunter""");
  23. timer1.Start(); label3.Text = textBox1.Text;
  24. }
  25.  
  26. private void button2_Click(object sender, EventArgs e)
  27. {
  28. Process.Start("Shutdown", "-a"); timer1.Stop();
  29. }
  30.  
  31. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  32. {
  33. switch (comboBox1.SelectedIndex);
  34. {
  35. case0 shutdown = "-s";
  36. case1 shutdown = "-r";
  37. case2 shutdown = "-l";
  38.  
  39. }
  40. }
  41.  
  42.  
  43.  
  44. private void timer1_Tick(object sender, EventArgs e)
  45. {
  46. label3.Text = (Convert.ToInt32(label3.Text) - 1).ToString;
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement