开发者

Unable to open browser from c# winforms

开发者 https://www.devze.com 2022-12-14 06:48 出处:网络
I am using following code to open an IE browser from toolstipmenu_click() but getting this message as:

I am using following code to open an IE browser from toolstipmenu_click() but getting this message as:

Error :No application is associated with the specified file for this operation

My code:

private void TutorialsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Process.Start("http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.speech.desktop&lang=en&cr=US");
            Webbrowser();            

        }

        private void Webbrowser()
        {
            System.Threading.Thread web = new System.Threading.Thread(new
            System.Threading.ThreadStart(launchbrowser));
            web.Start();
        }

        private void launchbrowser()
        {
            System.Diagnostics.Process.Start("http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.speech开发者_运维百科.desktop&lang=en&cr=US");
        }

Please assist me asap.


That technique has some known drawbacks as mentioned in this KB Article.

It could also be a problem with the querystring attached to the URL. Try launching it without the querystring and if that works you can proceed from there.


I would suggest you check the comment by Eric Law (of Microsoft) on the bottom of this answer to a very similar question.

Alternatively, there are a bunch of slightly different answers in that thread that will all do the job for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消