【发布时间】:2010-03-25 23:41:11
【问题描述】:
s += "<p style=\"text-align: left;\"><a href=\"javascript:window.print()\">PRINT</a></p>";
System.IO.File.WriteAllText(@"CheckForm.html", s);
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = "explorer.exe";
startInfo.Arguments = "CheckForm.html";
System.Diagnostics.Process.Start(startInfo);
当我尝试在 Windows 7 中打开我的 C# windows 应用程序时遇到问题,否则没有问题。
我无法使用上述代码在 Windows 7 中打开 explorer.exe。
有什么建议吗?
【问题讨论】:
-
为什么要在 Windows 资源管理器中打开网页?
-
因为每台电脑都有资源管理器。
-
绝对不是每台电脑。和 Windows 资源管理器!= Internet Explorer。详情见我的回答。
-
实际上,您的代码在 Windows 7 上适用于我。HTML 文档在我的默认浏览器中打开。你说的麻烦到底是什么?您是否尝试过为您的文档使用绝对路径?
-
当我尝试上面的代码时,Internet Explorer 没有打开。