且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

与应用程序的多个实例的静态成员的行为 - C#

更新时间:2023-11-22 21:09:22

变量静态与否的一部分,你的 aplication 的记忆。当你打开你的应用程序的两个实例的创建到的不同的的操作系统中的存储位置,所以在所有的两个变量之间没有任何关系。

The variable static or not is a part of your aplication memory. When you open 2 instances of your application you create to distinct memory locations in OS, so there is no any relation between those 2 variables at all.

如果你想创建一个(的关系),你要看看在不同的IPC(进程间通信)方法提供操作系统,如:

If you want to create one (relation), you have to look on different IPC (Inter Process Communication) methods available in OS, like:

  • Memory Mapped Files
  • Named Pipes
  • IPC Mechanisms in C# - Usage and Best Practices