Click here to Skip to main content
16,013,338 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there a way to get Isolated storage machine scope file.But only the machine scope file without application, app domain or user.

C#
IsolatedStorageFile.GetStore(IsolatedStorageScope.Machine, null);


I need to write a string that different applications and users can read.
Posted
Updated 27-Dec-11 22:14pm
v2
Comments
Karthik Harve 28-Dec-11 4:15am    
[Edit] pre tags added.

1 solution

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


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
 
Share this answer
 
v6
Comments
Espen Harlinn 28-Dec-11 18:59pm    
5'ed!
Sergey Alexandrovich Kryukov 28-Dec-11 19:00pm    
Thank you, Espen.
--SA
TolgaKaradayi 29-Dec-11 4:05am    
Thank you for your interest SAKryukov.
Here is my stuation:
I have two windows applications.App A the main application and app B doing some stuf to to app A work properly.Both of them using same mssql instance and two databases mostly the sql server is working on a 2003 or 2008 r2 server.I have two services a web service working on a host on somewhere and a win service working on the same local server that sql instance runs.Win service listens TCP connections from app B and comminicates with web service and returns some data.But to do that win service must query data base that app A using.
The main problem is win service must find a way to read connection string to connect sql instance from somewhere on local server.
I have a setup that diploys both two applications, asking sql instance and database parameters and creating a data base for two applications.Win service set up is different.Two applications reading connection string from app A application config file.

So how can win service read connection string?
Note:Win service is runing under NT AUTHORITY\NETWORK SERVICE.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900