How to make a timer to shutdown computer with c# windows form application
<p>i'm having trouble finding enough resources to create the windows form application that i want.As title says i want to create an application on which i can set a timer to shutdown computer.Any example or help would be appreciated.Regards</p>

<p>Edit:so i've mananged to put current date/time button and individual shutdown button the problem is i dont know how to set a timer on shutdown during the program is running.</p>

<p>Heres what i've put so far:</p>

<p>public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }</p>

<pre><code>    private void buttonTimerStart_Click(object sender, EventArgs e)
    {
        timer1.Start();

    }


    private void timer1_Tick(object sender, EventArgs e)
    {
        labelDate.Text = DateTime.Now.ToString();
    }

    private void buttonTimerStop_Click(object sender, EventArgs e)
    {
        timer1.Stop();
    }

    private void buttonShutdown_Click(object sender, EventArgs e)
    {
        Process.Start("Shutdown", "-s -t 0");

    }
</code></pre>
