本文介绍了隔离式存储机范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以获取隔离存储机器范围文件,但是只有机器范围文件而没有应用程序,应用程序域或用户.

Is there a way to get Isolated storage machine scope file.But only the machine scope file without application, app domain or user.

IsolatedStorageFile.GetStore(IsolatedStorageScope.Machine, null);



我需要编写一个字符串,不同的应用程序和用户可以读取该字符串.



I need to write a string that different applications and users can read.

推荐答案

TolgaKaradayi写道:
TolgaKaradayi wrote:

我需要编写一个字符串,供不同的应用程序和用户阅读.

I need to write a string that different applications and users can read.



亲爱的托尔加,

您难道没有发现这听起来与 隔离存储的目的正好相反吗?

请彻底了解隔离存储: http://msdn.microsoft.com /en-us/library/3ak841sy%28v=VS.100%29.aspx [ ^ ].

隔离存储旨在根据应用程序/进程的持久性存储将它们彼此隔离,这与在操作内存空间方面将它们隔离的方式相接近.

如果需要一些可供其他应用程序读取的存储,则需要这些应用程序通过此存储与您的应用程序进行通信,该存储将进入进程间通信(IPC)的完全不同的字段, http://en.wikipedia.org/wiki/Inter-process_communication [ ^ ].

由于既需要共享数据资源又需要其持久性,并且假设还需要保留数据完整性,那么看来,最可靠的解决方案是拥有一些(也许很小的)数据服务,该服务将保持对持久媒体的独占访问权(是的,可以隔离存储),并代表客户端执行对这些数据的访问.这样,当来自客户端的请求被序列化时,很容易在应用程序所需的任何意义上保持数据完整性.如果可能很简单,则不一定是像数据库管理系统那样成熟的东西(但这是无论如何都需要RDBMS功能的另一种选择);它可能是一个简约的Windows服务.对于通信层,它可以是任何东西,从命名管道和套接字到.NET远程到WCF.我在过去的解决方案中简要介绍了通信级别:

我如何将byte []发送到另一台PC [ ^ ],
在局域网上与两个Windows应用程序进行通信. [^ ].

希望我能正确理解您的意思.如果没有,请澄清.
您知道,首先应该解释您的最终目标,而不要沉迷于您正在考虑的任何技术手段.如果这样做,您将有更好的机会获得一些更有用的建议.

最好,

—SA



Dear Tolga,

Don''t you see that this sounds like directly opposite to the purpose of isolated storage?

Please read about isolated storage thoroughly: http://msdn.microsoft.com/en-us/library/3ak841sy%28v=VS.100%29.aspx[^].

Isolated storage is designed to isolate applications/processes from each other in terms of their persistent storage, which is closed to the way they are isolated in terms of operating memory space.

If you need some storage which different applications can read, you need those applications to communicate with your application through this storage, which goes to a completely different field of Inter-Process Communications (IPC), http://en.wikipedia.org/wiki/Inter-process_communication[^].

As you need both shared data resource and its persistence, and assuming you also need to preserve data integrity, it looks like the most robust solution is having some (perhaps tiny) data service which would keep exclusive access to the persistent media (and yes, it can be isolated storage) and performs access to this data on behalf of the clients. This way, as requests from client are serialized, it would be easy to preserve data integrity in any sense required by the applications. If can be something simple, not necessarily something fully-fledged like a database management system (but this is another option in cases where RDBMS functionality is needed anyway); it could be a minimalistic Windows Service. For communication the layer, it could be anything from named pipes and sockets to .NET remoting to WCF. I provided a short overview of communication levels in my past solutions:

how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

I hope I understood your correctly. If not, please clarify.
You know, you should first of all explain your ultimate goals, without preoccupation with any technical means you were thinking about. If you do that, you can get a better chance to get some more useful advice.

Best,

—SA


这篇关于隔离式存储机范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 20:38