jaydeep
jaydeep

Reputation: 1

is it possible to get value from application 1.exe and passing those values to application 2.exe using C#...?

is it possible to get value from application 1.exe and passing those values to application 2.exe using C#...? like application 1.exe is in running mode while application 2.exe also running. Now suppose I want to pass some data from application 1.exe to application 2.exe without manual data entry. Is it possible to do so in automated mode using C#..?

Upvotes: 0

Views: 138

Answers (4)

jtabuloc
jtabuloc

Reputation: 2535

There are plenty of ways to achieve it using IPC's mechanism. But you haven't state if the two applications will be running in same machine or not?

Below are the list that could be used to achieve your goal.

Upvotes: 0

kb9
kb9

Reputation: 359

You MAY use MemoryMapping so one application write data with identificator to RAM and other reads it, more info available here: Memory-Mapped Files

It's one of easiest ways.

Upvotes: 0

KeV
KeV

Reputation: 2891

What you are describing is known as interprocess communication (IPC). There are plenty of communication approaches, which one you should choose basically depends on factors as decoupling in time, synchronization and space (i.e. their properties).

Some approaches

There exist whole courses about these approaches and their benefits/disadvantages. As pointed out in comments I guess this subject is too broad for SO.


A quick word :

  • Decoupling in time : Does all communicating processes have to be online at the time of communication?
  • Decoupling in space : Does the communicating processes have to know each other?
  • Decoupling in synchronization : Blocking on communication?

Different approaches have different properties.

An example :

Approach : Message Queue

Assumptions : Communicating parties enqueue/dequeue messages

Properties : Decoupled in time (message queue is always there, communicating parties can be online/offline),

decoupled in space (communicating parties only know the message queue),

decoupled in synchronization? (depends on implementation, e.g. blocking dequeue on empty queue).

Java offers the Java Message Service (JMS) which really supports a lot of approaches, I guess there must be C# equivalent.

Upvotes: 2

WDS
WDS

Reputation: 984

Memory maps are one way. Named and unnamed pipes are another. You could even, if you wanted a more "quick and dirty" way, write to file with one and read it with the other. There are a few ways. But I would prefer named pipes out of all of these options.

Upvotes: 0

Related Questions