private void btnProcess_Click(object sender, RoutedEventArgs e)
{
Process p = new Process();
ProcessStartInfo psinfo = new ProcessStartInfo("chrome.exe", "http://projecteuler.net/problems");
p.StartInfo = psinfo;
p.Start();
}
private void btnProcess_Click(object sender, RoutedEventArgs e)
{
Process p = new Process();
try
{
ProcessStartInfo psinfo = new ProcessStartInfo(@"C:\chrome.exe");
p.StartInfo = psinfo;
//Chrome'un yeri
p.Start();
}
catch (Exception hata)
{
System.Diagnostics.Process.Start("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","http://projecteuler.net/problems");
}
}
private void btnProcess_Click(object sender, RoutedEventArgs e)
{
List<string> tarayicilar = new List<string>() { "chrome.exe", "firefox.exe", "iexplore.exe" };
bool webSayfasiAcildimi = false;
//Sırasıyla tüm tarayıcıları deneyecek
for (int i = 0; i < tarayicilar.Count; i++)
{
Process p = new Process();
try
{
ProcessStartInfo psinfo = new ProcessStartInfo(tarayicilar[i],"http://projecteuler.net/problems");
p.StartInfo = psinfo;
//Aşağıdaki satırın istisna fırlatma potansiyeli var
p.Start();
MessageBox.Show("Web sayfası "+tarayicilar[i]+" ile açıldı.");
webSayfasiAcildimi = true;
break;
}
catch (Exception)
{
}
}
if (webSayfasiAcildimi == false)
MessageBox.Show("Web sayfası tanımlı herhangi bir tarayıcı tarafından açılamadı.");
}
Bu sitenin çalışmasını sağlamak için gerekli çerezleri ve deneyiminizi iyileştirmek için isteğe bağlı çerezleri kullanıyoruz.