Click here to Skip to main content
11,712,524 members (73,626 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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:07am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 at 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 at 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 at 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)

  Print Answers RSS
0 CHill60 335
1 Sergey Alexandrovich Kryukov 289
2 OriginalGriff 230
3 Andy Lanng 160
4 Maciej Los 130
0 CHill60 335
1 Sergey Alexandrovich Kryukov 280
2 OriginalGriff 230
3 Andy Lanng 160
4 Maciej Los 130


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100