使用另一个应用程序打开文件

发布于 2024-10-19 04:28:49 字数 112 浏览 9 评论 0原文

嘿!

我想使用指定的应用程序从 C++ 打开 .xml 文件(知道文件的路径和应用程序的路径)。与右键单击文件并单击“打开方式...”相同,然后选择要启动的应用程序。

提前致谢!

Hy!

I want to open an .xml file from c++ with a specified application (knowing the path of the file and the path of the application). Same way as you would right-click the file and click "Open with..." and choose the application to start with.

Thanks in advance!

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

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

发布评论

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

评论(2

余生再见 2024-10-26 04:28:49

通常应用程序允许使用命令行参数打开文件。例如,要使用记事本打开文件,您可以使用命令行:

notepad.exe a.txt

这就是为什么您可以在 Windows 中使用此功能(允许指定参数)或其他操作系统中的类似功能。华泰

Usually applications allow command line arguments for file opening. For example, to open a file with notepad you can use command line :

notepad.exe a.txt

That's why you can use this feature with CreateProcess in Windows (which allows specifying arguments) or analogous function in other OS . HTH

極樂鬼 2024-10-26 04:28:49

简单地怎么样:

system("application.exe file.xml");

how about simply:

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