【发布时间】:2014-08-06 10:02:58
【问题描述】:
我有一个非常简单的程序,它有 4 个按钮,每个按钮打开一个 url。 我想要的是让每个按钮都使用 Firefox 作为默认浏览器。 我知道我可以将其设置为默认浏览器,然后它将起作用,但是如果用户将 Internet Explorer 设置为默认浏览器,它将在其中打开。 这些 url 仅适用于 Firefox,因为它存在证书问题。 所以基本上我的问题是我如何更改我的代码以确保如果您单击 4 个按钮中的任何一个,它将在 Firefox 而不是 Internet Explorer 中打开。 这是我的代码
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://192.168.2.56/dummy.htm?settings=save&user_active1=on");
BtnOff.BackColor = Color.Red;
Bnton.BackColor = Color.Chartreuse;
}
private void button2_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://192.168.2.56/dummy.htm?settings=save&user_active1=off");
Bnton.BackColor = Color.Red;
BtnOff.BackColor = Color.Chartreuse;
}
private void button3_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://217.20.xxx.xxx/api/agent/pause.json?active_host=217.20.xxx.xxx&active_user=3012532&username=buildstore&password=cha9pU7U&client=snom");
BtnDND.BackColor = Color.Chartreuse;
BtnQue.BackColor = Color.Red;
}
private void button4_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://217.20.xxx.xxx/api/agent/unpause.json?active_host=217.20.xxx.xxx&active_user=3012532&username=buildstore&password=cha9pU7U&client=snom");
BtnQue.BackColor = Color.Chartreuse;
BtnDND.BackColor = Color.Red;
}
感谢您花时间欣赏它。
【问题讨论】: