c# - Can a Singleton Class inside a DLL be shared across processes? -


I have a custom. I am creating a Net Hardware framework that will be used by other programmers to control some hardware. They will add a reference to our DLL to reach our hardware infrastructure. I need a shared class that will be accessed with multiple applications (processes).

What I want a singleton pattern, but it only works for many sources within your process. I may be completely wrong but here is an example of the C # code which I currently have. I can not help feeling that the design is wrong. I wish I could share more specific information but I can not do it

  • I have to emphasize that there will be no control over my client application.
  • New Resource (); Public string data; Personal Resources () {Data = DateTime.Now.ToString (); } Examples of public static processing {return {return m_instance; Examination: (Finally, customer AP)

      class program {static zero main (string [] args) {Console.WriteLine (" Enter the resource to capture! "); Console.ReadLine (); Var processing = resource Console.lightline ("\ r \ n {0}: {1} \ r \ n", thread.contentthread.monettraredredID, resource.data); Background Worker = new backgroundwork (); Worker.DoWork + = WorkerDoWork; Worker.RunWorkerAsync (); While (Worker. ISBC) {Thread. Sleep (100); } Console.WriteLine ("Enter the process to close!"); Console.ReadLine (); } Fixed zero worker dockwork (object sender, DoWorkEventArgs e) {var resource = resource. Console.lightline ("\ r \ n {0}: {1} \ r \ n", thread.contentthread.monettraredredID, resource.data);  

    The first Launched application returns output:

    Enter to capture the resource!

    1: 6 / 24/2009 8:27:34 am

    3: 6/24/2009 8:27:34 AM

    To stop the process Enter for!

    The second application returns an output:

    Enter to capture the resource!

    9: 6/24/2009 8:27:35 AM

    10: 6/24/2009 8:27:35 AM

    To Stop Process Enter for!

    Conclusion :

    I want to see both applications that return the same string of time immediately before the class.

    As you can see, the singleton works for multiple threads within the process but the cross-processes can not possibly be done because I can not find any solution.

You can not use a singleton to run in applications to run in their own application space And, in case of security, memory / object etc. can not be used. To sync the other (such as Remotting) two without any means of communication, they have to be remotely remote in a third program.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -