各位大哥,小弟有个问题困惑好久了
我用C#开发了一个winfrom 里面用到了Webbrowser 控件。URL是网上的一个网站,当然这网站是我来控制的。现在我想做的是这网站里面有个连接,能否不要让他在Webbrowser 里显示,而是跳出软件用IE或其它默认浏览器来打开。
我用C#开发了一个winfrom 里面用到了Webbrowser 控件。URL是网上的一个网站,当然这网站是我来控制的。现在我想做的是这网站里面有个连接,能否不要让他在Webbrowser 里显示,而是跳出软件用IE或其它默认浏览器来打开。
看看能不能解决你的问题.
private void wb_Container_NewWindow(object sender, CancelEventArgs e)
{
e.Cancel = true;
string newURL = wb_Container.StatusText;
//'open
}
获取newURL后,
System.Diagnostics.Process.Start("IEXPLORE.EXE",newURL);
System.Diagnostics.Process.Start("IEXPLORE.EXE",“你的网址哦”);
if (int.Parse(das) <= 10)
{
this.Image1.InnerHtml = "<a href=\"http://my-stg1.netgear-support.com/mynetgear/gearhead/portal/pta.aspx?nextpage=ghtransaction&country=United%20States \" target=\"_parent\"><img src=\"images/renew_10_button.png\" border=\"0\"></a>";
}
else if (int.Parse(das) <= 15 && int.Parse(das) > 10)
{
this.Image1.InnerHtml = "<a href=\"http://my-stg1.netgear-support.com/mynetgear/gearhead/portal/pta.aspx?nextpage=ghtransaction&country=United%20States \" target=\"_parent\"><img src=\"images/renew_15_button.png\" border=\"0\"></a>";
}
else if (int.Parse(das) > 15)
{
this.Image1.InnerHtml = "<a href=\"http://my-stg1.netgear-support.com/mynetgear/gearhead/portal/pta.aspx?nextpage=ghtransaction&country=United%20States \" target=\"_parent\"><img src=\"images/subscribe_button.png\" border=\"0\"></a>";
}