Jack
Jack

Reputation: 16724

Send data to another application via C#

I'm looking for an example code written in C# how do I the communication of my application with another application using. I have an another application that have an ComboBox. I want set the value of this Combobox from my application, using C# code.

Upvotes: 0

Views: 4590

Answers (4)

Andrew Savinykh
Andrew Savinykh

Reputation: 26329

Some code samples can be found here: http://1code.codeplex.com/wikipage?title=IRPC

Upvotes: 0

David S.
David S.

Reputation: 11200

In your case, there are two ways:

  1. RPC, the preferred way. the 'other' app should expose RPC API, you the app can invoke and communicate with the 'other' app;
  2. UI Automation, the bad way. You can use Windows API to get a handle of the ComboBox in the 'other' app, and send key stroke event to stimulate human interaction. But it is not reliable. E.g. you cannot lock your screen when the app is running, or you cannot stimulate the action.

Upvotes: 1

Keith Nicholas
Keith Nicholas

Reputation: 44316

you can use a number of technologies.... none are super simple.

  • Sockets
  • MSMQ
  • Named Pipes
  • WCF ( which wraps the three above, and other techniques, can be a bit fiddly to get working)
  • DCOM
  • Windows "SendMessage"
  • Files
  • Shared Memory

Upvotes: 4

KV Prajapati
KV Prajapati

Reputation: 94653

You need to learn and use Windows Communication Foundation. Have a look at MSDN article - What Is Windows Communication Foundation?

Upvotes: 1

Related Questions