Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# winforms如何使用activex控件的url启动ie_C#_Winforms_Activex - Fatal编程技术网

C# winforms如何使用activex控件的url启动ie

C# winforms如何使用activex控件的url启动ie,c#,winforms,activex,C#,Winforms,Activex,我正在编写一个Windows应用程序,在一个按钮的单击事件中,我想启动Internet Explorer(不是默认浏览器)以及一个ActiveX控件,我有一个URL指向该控件。以下是我尝试过的: private void myButton_ Click(object sender, EventArgs e) { string startMyProcess; startMyProcess = "http://myservername/directory/m

我正在编写一个Windows应用程序,在一个按钮的单击事件中,我想启动Internet Explorer(不是默认浏览器)以及一个ActiveX控件,我有一个URL指向该控件。以下是我尝试过的:

 private void myButton_ Click(object sender, EventArgs e)
    {
        string startMyProcess;
        startMyProcess = "http://myservername/directory/myactivex.application";


        //Start my process
        try
        {
            ProcessStartInfo startInfo = 
                new ProcessStartInfo(@"C:\Program Files\Internet Explorer\iexplore.exe", 
                     startMyProcess);
            Process.Start(startInfo);
            startInfo = null;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

非常感谢您的帮助,谢谢。

什么不起作用?这正是它应该做的,打开IE到指定的URL。另外,捕获一个
异常
然后抛出它并不是一个好的做法,因为它只是在一个额外的步骤中包装将要发生的事情。出了什么问题?是否引发了异常?该计划根本没有启动吗?最终成为一个网络政策问题。谢谢你的帮助。