无法从 C# winforms 打开浏览器
我正在使用以下代码从 toolstipmenu_click() 打开 IE 浏览器,但收到此消息为:
错误:没有应用程序与此操作的指定文件关联
我的代码:
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");
}
请尽快帮助我。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该技术有一些已知的缺点,如这篇知识库文章中所述。
也可能是附加到 URL 的查询字符串有问题。尝试在没有查询字符串的情况下启动它,如果有效,您可以从那里继续。
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.