首先能够打开一个网页或者程序,有以下几种方式
1.使用ie打开网页
System.Diagnostics.Process.Start("iexplore.exe", "http://blog.csdn.net/wuma0q1an");
2.使用系统默认浏览器打开
System.Diagnostics.Process.Start("explorer.exe", "http://blog.csdn.net/wuma0q1an");
<pre code_snippet_id="1710248" snippet_file_name="blog_20160607_4_1801188" name="code" class="csharp">System.Diagnostics.Process.Start("http://blog.csdn.net/wuma0q1an");
3.调用注册表打开
RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command\");
string s = key.GetValue("").ToString();
System.Diagnostics.Process.Start(s.Substring(0, s.Length - 8), "http://blog.csdn.net/wuma0q1an&#

本文介绍了如何在C#的Windows服务中实现打开网页或应用程序的方法,包括使用IE浏览器和系统默认浏览器,并强调了在服务中启用'允许服务与桌面交互'选项的重要性。
最低0.47元/天 解锁文章
247

被折叠的 条评论
为什么被折叠?



