在 C# 中的两个独立 Windows 应用程序之间共享数据 [英] Sharing data between two independent Windows applications in C#

查看:21
本文介绍了在 C# 中的两个独立 Windows 应用程序之间共享数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have two applications that use my clients database(s), but have no mutual dependency. The problem is that I need to make an application for configuration in which the administrator could set the parameters. For instance which database to which the two applications connect and some other parameters, mostly string and numerical. These parameters must affect both applications.

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

The first solution that I thought of is to make a configuration file in which I could store the data and the applications would read that file on startup. The problem with this approach is that it is not very safe (even if I encrypt the data in the file).

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

Is there a way to send data from one application to the other, assuming that each application is created as an individual project?

推荐答案

或者你甚至可以使用命名管道:http://www.eggheadcafe.com/articles/20060404.asp或者通过socket进行通信.

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.

最好的问候,西尔万.

这篇关于在 C# 中的两个独立 Windows 应用程序之间共享数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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