Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have recently made a program that has a string collection in it, for example it will have this

string collection name = stringdata
hi<br />
1234<br />
4321<br />
hello<br />
1234<br />
4321


and lets call the program "program X".

Now I have made a program that is "program X" but I just updated it. And now We call this "program X" "program Y" now, because it is just an updated version of it.

I want to access the stringdata from "program X" and put the stringdata into "program Y" is this possible?
Posted

1 solution

You can't access the memory of a running program from a different program (or even from a separate running instance of the same program) so unless you wrote "Program X" to expose it in some way (via a file, or a socket connection, or some other means) then you cannot access it in "Program Y".

Trying to access the memory of a different application is one of the main reasons for an application crashing - whether it is deliberate or not you can't access outside your own processes memory space.
 
Share this answer
 
Comments
[no name] 2-Feb-13 6:15am    
Ah I see I thought I probably couldn't do it :( can you please give me some information on this socket? It my be useful if I want to update a program
OriginalGriff 2-Feb-13 6:32am    
There is a good guide to sockets here:
http://www.codeproject.com/Articles/5252/Sockets-in-C
(ignore the name, it's C# - '#' isn't a normal character!)
But if you are designing from scratch, it might be an idea to read up on WCF instead - it's a much more modern way to do it!
Garth J Lancaster 2-Feb-13 6:33am    
As per OriginalGriff's Solution : there are plenty of examples of socket servers etc out there on the net - eg http://tech.pro/tutorial/704/csharp-tutorial-simple-threaded-tcp-server ..

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