c# - 如何调出 "Windows cannot open this file"对话框?

标签 c# visual-studio-2005 file-association process.start

我的用户可以将文档附加到应用程序中的各种实体。当然,如果用户 A 附加了一个 .TIFF 文件,则用户 B 可能没有该类型文件的查看器。

所以我希望能够调出这个对话框:

alt text http://www.angryhacker.com/toys/cannotopen.png

我的应用程序是 C# 和 VS2005。
目前我执行 Process.Start 并传入文件名。如果未找到关联,则抛出异常。

最佳答案

Process pr = new Process();
pr.StartInfo.FileName = fileTempPath;
pr.StartInfo.ErrorDialog = true; // important
pr.Start();

关于c# - 如何调出 "Windows cannot open this file"对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/884012/

相关文章:

c# - 变量前缀 (“Hungarian notation” ) 真的有必要了吗?

c# - native 代码的调试

Eclipse RCP : programmatically associate file type with Editor?

c# 日期格式不显示本地格式

C# 将 DynamicObject 转换为任意类型

visual-studio - 是否有用于 native C++ Win32 服务的 VisualStudio 项目模板?

c# - 有没有一种简单的方法可以通过 C# 中的扩展名来确定文件是什么?

delphi - 将 Chrome 检测为与 Windows 中的 html 文件关联的浏览器

c# - CopyToDataTable : Why exactly does it throw an error if one field is NULL, 以及如何修复它?

c++ - 这个 GetDefaultAudioEndpoint 程序有什么问题?