Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2007

Tip: Looking for answers? Try searching our database.

Sending messages between two C# programs...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sunburned Surveyor - 28 Jun 2007 20:22 GMT
I'm very new to C# programming, but I have been writing programs in
Java for several years. I'm trying to find a simple way to send short
messages and data packages between two separate C# programs running on
the same computer.

I found a library on CodeGuru that allows this to be done using .NET
wrappers of Win32 named pipes. I also read that this can be done by
serializing and deserializing objects.

Is there a better way? I know I can use the serialization technique,
but it probably isn't the most elegant approach. I'm not sure if the
named pipes library is maintained anymore, and I don't know if it will
work on 64 bit Windows.

I appreciate any suggestions on how to handle this. Please note that I
do not need a solution that will allow communication over the internet
or a network. My two processes will always be running on the same
machine.

Thanks,

The Sunburned Surveyor
Peter Duniho - 28 Jun 2007 21:03 GMT
> I'm very new to C# programming, but I have been writing programs in
> Java for several years. I'm trying to find a simple way to send short
> messages and data packages between two separate C# programs running on
> the same computer. [...]

.NET supports "remoting", which is probably the easiest mechanism (I'm  
told) if you only need to handle .NET applications talking to each other.

Outside of .NET, named pipes is a very common mechanism and I doubt it's  
going away any time soon.  It's been around forever, and Microsoft has had  
plenty of chances to kill it off without doing so.  Microsoft has a strong  
history of maintaining backward compatibility and while there are  
exceptions, I doubt named pipes will be one of them.

Other mechanisms that are well-known and commonly used are using sockets  
(essentially network i/o) and shared memory mapped files.  The latter  
performs (slightly) better, but in some cases using a socket-based  
paradigm is simpler.  It kind of depends on what you want to do.

Pete
Eugene Mayevski - 29 Jun 2007 06:22 GMT
Hello!
You wrote  on Thu, 28 Jun 2007 19:22:07 -0000:

SS> I appreciate any suggestions on how to handle this. Please note that I
SS> do not need a solution that will allow communication over the internet
SS> or a network. My two processes will always be running on the same
SS> machine.

Check MsgConnect ( http://www.msgconnect.com ). It does exactly what you
need.

With best regards,
Eugene Mayevski
http://www.SecureBlackbox.com - the comprehensive component suite for
network security

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.