本文介绍了如何跨进程共享类属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我刚被问到如何在两个运行应用程序的之间共享功能和属性。例如,我的App1和App2都运行在 相同的机器上。 App1使用包含函数SetProp()的DLL(可能)。 当App1调用它时,DLL中的属性设置为abc。 App2在同一个DLL中调用了一个 函数GetProp()。 GetProp()应该返回abc。 这听起来像一个简单的事情,但是让DLL变量共享 并使两个应用程序都加载相同的DLL不起作用。经过反思, 我可以看出为什么这不会(不应该)有效,但是怎么做呢; 最好不要跳过安检篮球。 TIA Charles 解决方案 反射, I have just been asked how to share functions and properties between tworunning applications. For example, I have App1 and App2 both running on thesame machine. App1 uses a DLL (perhaps) that contains function SetProp().When App1 calls it, a property in the DLL is set to "abc". App2 calls afunction GetProp(), in the same DLL. GetProp() should return "abc".This sounds like a simple thing to do, but making the DLL variable sharedand making both applications load the same DLL does not work. On reflection,I can see why that wouldn''t (shouldn''t) work, but how can it be done;preferably without having to jump through security hoops.TIACharles 解决方案 the reflection, 这篇关于如何跨进程共享类属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!