各位大哥,小弟有个问题困惑好久了
我用C#开发了一个winfrom 里面用到了Webbrowser 控件。URL是网上的一个网站,当然这网站是我来控制的。现在我想做的是这网站里面有个连接,能否不要让他在Webbrowser 里显示,而是跳出软件用IE或其它默认浏览器来打开。

解决方案 »

  1.   

    http://www.chenjiliang.com/Article/View.aspx?ArticleID=19101
    看看能不能解决你的问题.
      

  2.   

    在_NewWindow事件通过wb_Container.StatusText来获得当前将要打开的页面。代码可以这样写:
            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);
      

  3.   

    用进程调用ie
    System.Diagnostics.Process.Start("IEXPLORE.EXE",“你的网址哦”);
      

  4.   

    但是我的链接,不是在软件里面。是在网站里面,贴出以下代码。
                        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>";
                        }