2

我有两个应用程序使用我的客户数据库,但没有相互依赖关系。问题是我需要创建一个配置应用程序,管理员可以在其中设置参数。例如,两个应用程序连接到哪个数据库以及其他一些参数,主要是字符串和数字。这些参数必须影响这两个应用程序。

我想到的第一个解决方案是制作一个配置文件,我可以在其中存储数据,并且应用程序会在启动时读取该文件。这种方法的问题在于它不是很安全(即使我加密了文件中的数据)。

假设每个应用程序都是作为单独的项目创建的,有没有办法将数据从一个应用程序发送到另一个应用程序?

4

2 回答 2

3

You can use Memory-Mapped Files

You can use it as a file, and access from different executables.

Build your own class for interfacing with it.

Tutorials:

Programming Memory-Mapped Files with the .NET Framework

Working with memory mapped files in .NET 4

于 2013-04-26T10:30:26.247 回答
3

or you can even use named pipe : http://www.eggheadcafe.com/articles/20060404.asp Or make communication with socket.

You have a plenty of solution. If you need more details, feel free to ask.

Best regards, Sylvain.

于 2013-04-26T10:32:00.890 回答