Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# ile Bilgisayar Kapatma Programı Yapmak
#1
Rainbow 
C# ile Bilgisayar Kapatma Programı Yapmak

Bu derste kodlarını verdiğim programla bilgisayarınızı otomatik olarak kapatabileceksiniz.

[Image: rq2j.jpg]


Code:
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");
        }
    }
}
[Image: vmpt.gif]
·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙˜”*°•. || Türk Team - SaNcArHaN71 || .•°*”˜˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping