C# Bilgisayar Kapatma Programı Yapımı

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üye
Katılım
16 Ara 2015
Mesajlar
21
Tepki puanı
0
10 HİZMET YILI
[font=Verdana, Arial, sans-serif]Sayın MemoryHackers Üyeleri Bu Derste Kodlarını Verdiğim Programla Bilgisayarınızı Otomatik Olarak Kapatabileceksiniz.

1 GroupBox , 1 Combobox , 2 Button Ekleyin.
[/FONT]


[font=Verdana, Arial, sans-serif]Kod:[/FONT]
Kod:
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;

namespace WindowsFormsApplication32
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            if (comboBox1.Text == "10 dak")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 600");
            }
            else if (comboBox1.Text == "15 dak")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 900");
            }
            else if (comboBox1.Text == "30 dak")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 1800");
            }
            else if (comboBox1.Text == "1 saat")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 3600");
            }
            else if (comboBox1.Text == "2 saat")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 7200");
            }
            else if (comboBox1.Text == "5 saat")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 18000");
            }
            else if (comboBox1.Text == "10 saat")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 36000");
            }
            else if (comboBox1.Text == "15 saat")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 54000");
            }
            else if (comboBox1.Text == "24 saat")
            {
                System.Diagnostics.Process.Start("shutdown", "-f -s -t 86400");
            }
            
            else
            {
                MessageBox.Show("Kapanma zamanını belirleyiniz");
            }
        }

        

        private void button2_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("shutdown", "-a");
        }
    }
}
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst