I have sample windows app written in C # .net and I have a global variable on which I have different Applications must be shared when my app is running.
The code below is:
using System.Linq; Using System.Text; System usage threading. Task; Using System.Windows.Forms; Namespace Test {Public Partial Class} Form 1: Form {Public String GlobalValue = string.Empty; Public Form 1 () {Initialization (); } Private Zero Button 1_Click (Object Sender, EventArgs E) {If ((textbox1.Text! = "") & Amp; (textbox1.Text! = Null)} {GlobalValue = textbox1.Text.ToString (); }}}}
In the above code, the user enters a value in the text box and updates on the Global Value button click event.
I have variables in various applications by GlobalValue and how do I do it in C #. Suppose I am running a 3D mark with my sample app and it should be accessible to the Global Value 3D Mark app or any other app.
I do not want to use the registry to store the price.
If an example has been given, then it would be really helpful for me.
Thank you,
You read it about Interprosession Communication Should and should choose the best remedy for your use case.
In short:
File Mapping is an easy way to share information (your data looks like a file) but you need to use primitive for interoperability synchronization .
Pipes and windows sockets will help you to overcome the synchronization issue, but you will need the appropriate code in all applications that require the use of variable (read or write).
Comments
Post a Comment