以编程方式调用文件类型的默认应用程序

发布于 2024-09-11 03:31:10 字数 231 浏览 3 评论 0原文

关于此的相关注释问题,假设我有一个定义了处理程序的文件,我将如何以编程方式调用注册的处理程序?不一定需要实际的代码来执行此操作,只需指向一些文档或谷歌术语即可。

谢谢,

克里斯

On a related note to this question, say I've got an file with an handler defined, how would I programatically invoke the registered handler? Don't necessarily need the actual code to do this, just a pointer to some docs or the terminology to google for this.

Thanks,

Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

入怼 2024-09-18 03:31:10

启动一个新进程并指定要使用默认应用程序打开的文件就足够了 - 其余的由 Windows 处理。在 C# 中,这是按如下方式完成的。

Process.Start("Foo.jpg");

这将使用 JPEG 图像的默认应用程序打开图像。

It is sufficent to start a new process specifying the file you want to open with the default application - the rest is handled by Windows. In C# this is done as follows.

Process.Start("Foo.jpg");

This will open the image using the default application for JPEG images.

小草泠泠 2024-09-18 03:31:10

ShellExecute 函数及其高级表兄弟, ShellExecuteEx

There's the ShellExecute function and its advanced cousin, ShellExecuteEx.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文