I would like to create a Class Library DLL in C#, that will have a Static Class in it. That static class has 1 private static member(int), with a public static property for it.
What I want is, that for Every C# Application that references this DLL, it will get the same static class.
Meaning If Application1 changes the static member's value to be 5, and then Application2 tries to get the value of the propery, it will get: 5.
Despite the fact that those are two different applications(EXEs).
In simply words, I want this whole class library to be "static", so only once will be loaded of it to memory, and then its single value will be shared accross different EXEs that reference it.
Thank you
Syntax of function prototypereturnType functionName(type1 argument1, type2 argument2, ...); In the above example, int addNumbers(int a, int b); is the function prototype which provides the following information to the compiler: name of the function is addNumbers() return type of the function is int.
C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...
Aside from a compiler, the only other software requirement is a text editor for writing and saving your C code.
C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.
An attractive solution to shared data amongst all processes on the same computer is shared memory. You will have to rewrite your properties to retrieve the shared value, and the class will be loaded multiple times into each process that uses your library, but it will behave as though there were only one copy, if you do it correctly.
Here is a StackOverflow question to help you get started:
It links to a complete shared-memory library you can use.
What you're looking for is some form of IPC or RPC. One option is .NET Remoting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With