Click here to Skip to main content
13,054,615 members (61,277 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Im having problem putting an idea into practice. The idea is that i am running a client server application. The client connects and sends data (obviously). The users are dealt with at the server side by a class called UserCollection which stores there info. I also wanted each client to send all the running processes to the server so that i can select a client and show all the running processes from that user. The problem lies in how to link clients to ProcessCollections (thats the class used to store all the process via System.Diagnostics.Process.GetProcesses()). How do I link in the class, the processes in an array to the clients.

Posted 21-Nov-12 12:09pm
Sergey Alexandrovich Kryukov 21-Nov-12 18:43pm
What is "send processes"? How a process can be sent?

1 solution

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

Solution 1

Not only for network application parts, but simply for a pair of different processes, the code and hence classes can be the same, but objects, class instances are always different. Processes are thoroughly isolated from each other. For communication, you need IPC. And when it comes to sending data encapsulated in classes, serialization is involved. An instance (but generally, a whole object graph of arbitrary topology) is serialized into an array of bytes, sent to another process and deserialized on the other end.

Please see:[^],[^].

One most advanced and easy-to-use method of serialization is Data Contract:[^].

Please see also my past answers on Data Contract:
How can I utilize XML File streamwriter and reader in my form application?[^],
Creating property files...[^],
deseralize a json string array[^].

Serialization is already embedded in "classical" .NET remoting, and Data Contract — in WPF:[^],[^],[^],[^],[^],[^].

Nelek 22-Nov-12 17:06pm
OP's comment moved from non-solution below
Sorry if i wasnt clear.

I get the processes by using GetProccess() then cycling through each process adding it to an array of proceses. I then send the array using Winsock Orcas etc. Once the array is received i can access each process individually by cycling through the array and outputting it to the screen or whatever. What I want to be able to do is to have multiple process arrays coming in from different clients each somehow linked to its client guid. Therefore, i could then get the processes for each user individually (ie I select a user from a list and see all processes associated with it). I thought this would best be done by a class for storing all the clients info by guid. At the moment the class used to store user info has things like username and guid etc as properties. So how would I implement this?
Not quite clear what's the problem...
Shmuli9 25-Nov-12 15:24pm
Dont worry, I have managed to solve the problem by making one of the properties in the class an array. Thanks

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2017
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