C# İLE UYGULAMA AÇMA VE KAPATMA
C# ile uygulama açıp kapatan basit bir program yapacağız.
ÖNCELİKLE BİR FORM UYGULAMASI OLUŞTURUP BUTONLARIMIZI VE BİR TANE PHİCTUREBOX EKLİYORUZ
BUTONLARIMIZIN İSMİNİ "button_ac" ve "button_kapa" OLARAK AYARLIYORUZ.
Daha sonra butonlara tekere teker çif tıklayarak kod kısmına geliyoruz ve kodlarımızı yazıyoruz.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
namespace Program_açma_kapama
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button_ac_Click(object sender, EventArgs e)
{
Process.Start(@"C:\Program Files\Google\Chrome\Application\chrome.exe");
}
private void button_kapa_Click(object sender, EventArgs e)
{
foreach(var islem in Process.GetProcessesByName("chrome"))
{
islem.Kill();
}
}
}
}

