如何制作运行应用程序并使其执行的.exe? [英] How do I make an .exe which runs an application and makes it do things?

查看:128
本文介绍了如何制作运行应用程序并使其执行的.exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#中创建了一个可以运行应用程序的.exe,但是我想让它运行它所运行的应用程序。例如:exe打开Microsoft Word,打开文档并关闭它。



我尝试过:



我还没有尝试过任何东西,因为我不知道从哪里开始。

I made an .exe in C# which can run an application, but I want to make it make the application that it ran do things. For example: the exe opens Microsoft Word, makes it open a document and closes it.

What I have tried:

I haven't tried anything yet, because I have no idea where to start.

推荐答案

最简单的解决方案是在启动其他应用程序时使用命令行参数。请参阅命令行参数( C#编程指南)| Microsoft Docs [ ^ ]。



对于更复杂的情况,您可以使用IPC(进程间通信)。因为有许多不同的IPC方法,我不能在不知道你想做什么的情况下建议一个(命令应该通过的时间和频率以及应该传递的数据量)。



CodeProject上有一些关于IPC的文章:搜索:c#ipc [ ^ ]
The simplest solution is to use command line arguments when starting the other application. See Command-Line Arguments (C# Programming Guide) | Microsoft Docs[^].

For more complex situtions you can use IPC (Inter Process Communication). Because there are many different IPC methods, I can't suggest one without knowing what you want to do (when and how often commands should be passed and the amount of data that should be passed).

There are some articles here at CodeProject about IPC: Search: "c# ipc"[^]


这篇关于如何制作运行应用程序并使其执行的.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆