Click here to Skip to main content
Sign Up to vote bad
good
See more: C#
I have recently made a program that has a string collection in it, for example it will have this
 
string collection name = stringdata
hi
1234
4321
hello
1234
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 2 Feb '13 - 0:07


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.
  Permalink  
Comments
TechXSoftware - 2 Feb '13 - 6:15
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:32
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:33
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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 198
1 Sergey Alexandrovich Kryukov 159
2 Richard MacCutchan 150
3 Maciej Los 136
4 Tadit Dash 110
0 Sergey Alexandrovich Kryukov 10,264
1 OriginalGriff 7,937
2 CPallini 4,201
3 Rohan Leuva 3,522
4 Maciej Los 3,135


Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid