Click here to Skip to main content
11,490,801 members (74,797 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WCF C#3.5
I have two applications, one Windows Service, second Windows Forms application. What would be the best way to send a message (its a small string 10 character length) from Windows Service to Windows Forms.

Any simple approach is highly appreciated.

Thanks,
Kishore
Posted 9-Dec-09 0:16am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You might use common storage to update this. Place your data in Registry / diskfile or whereever you want, and access it from both the process. This is the easiest.

Other than that, you might also use Named Pipes to send messages between two processes. Read this :

http://www.switchonthecode.com/tutorials/interprocess-communication-using-named-pipes-in-csharp[^]
http://www.codeguru.com/Csharp/Csharp/cs_network/remoting/article.php/c7259/[^]

Wink | ;)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I think the simplest would be to have a function in your form that queries the service, and returns the value.

You can put it in a thread, or a timer.

I Agree With Answer 2.
  Permalink  
v2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 521
1 Andy Lanng 288
2 Sascha Lefèvre 240
3 Maciej Los 195
4 OriginalGriff 173
0 Sergey Alexandrovich Kryukov 9,713
1 OriginalGriff 8,475
2 Sascha Lefèvre 3,544
3 Maciej Los 3,106
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 13 Jan 2010
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