Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨!
我想用指定的应用程序从 c++ 打开一个 .xml 文件(知道文件的路径和应用程序的路径)。与右键单击文件并单击“打开方式...”并选择要开始的应用程序的方法相同。
提前致谢!
通常应用程序允许使用命令行参数来打开文件。例如,要使用记事本打开文件,您可以使用命令行:
notepad.exe a.txt
这就是为什么您可以在 Windows 中使用此功能CreateProcess(允许指定参数)或其他操作系统中的类似功能。高温高压
CreateProcess
简单地说:
system("application.exe file.xml");