1

I have Program A running with some variables. I wish to have a second program - Program B - that can be run seperately and when run will attach itself to Program A. From within Program B I'd like to be able to modify and change certain variables in Program A. Both programs have been written by me.

I have seen this happen with the likes of Dwarf Fortress and Dwarf Therapist which allows you to change various variables in one program which will make the changes in another.

I assume you setup an area of shared memory and reference the variables with pointers but is this possible with C#.Net and if so - how?

4

1 回答 1

2

您可以使用内存映射文件来创建一个内存区域,在应用程序之间共享。

但是更干净、更可靠的解决方案是在你的程序中引入一个 API,以便其他程序可以与之交互。为此,您可以使用 WCF、Thrift 或其他技术。

于 2013-04-28T16:25:52.220 回答