passing value from windows application to another one [duplicate] - c#

This question already has answers here:
What is the simplest method of inter-process communication between 2 C# processes?
(9 answers)
Closed 7 years ago.
How to pass value from a Windows desktop application to another Windows desktop application?
I'm stuck right now. I don't want to build two different forms in one Winform application.
I need two different Winform application that communicates with each other, one of them send value to other one and the receiver processes the data.
Anyone knows how to do that?
I'd be grateful if you can help.

You need to implement interprocess communication, Please check this link What is the simplest method of inter-process communication between 2 C# processes?
in this link you can find multiple options to implement interprocess communication such as:
Windows Communication Foundation
Windows Messages

Also you can use WCF for communicating between applications. Have look WCF - Fastest interprocess communication

If you are familiar with Remote Objects using Services (.Net Remoting), then your two application can communicate using this method.
You can refer to this link:
https://www.daniweb.com/software-development/csharp/code/227615/simple-net-remoting-demonstration

Related

Best way to consume WCF Service from Access application [duplicate]

This question already has answers here:
Calling WCF Service from MS Access
(2 answers)
Closed 7 years ago.
We have a WCF Service and now we are having to suppor tit in backward compatibility mode. One of the consumer turns out to be an Access Application. Now, I have personally never worked with Access and not sure if Access has a direct way to consume the WCF services. However, I came across following link:
http://jaliyaudagedara.blogspot.com/2014/02/calling-wcf-service-from-stored.html?m=1
Given the fact that I would be more comfortable working with SQL Server rather than doing any work in Access to do backward compatibility, I found this link as my best shot to backward compatibility.
Are there any other ways that I can approach this problem?
This question has already been asked and answered here:
Calling WCF Service from MS Access
In short, you can call a WCF service exposed via WebHttpBinding (simple HTTP) or BasicHttpBinding (SOAP/HTTP) using XMLHttp (for simple HTTP) or the SOAP Toolkit (for SOAP/HTTP).

Can Silverlight access USB port [duplicate]

This question already has answers here:
ASP.NET/Silverlight Control USB Device
(3 answers)
Closed 10 years ago.
I'm developing web application using MVC3 and the requirement is to access USB port. if not possible is there other way or workaround for accessing port using web browser. Please send me a sample link.
Thanks
You might find more answers if you provided detail on why your App required access to a USB port. If this Intranet, then you are talking Corporate and you have more control over the Client side. If this is Internet, it's hopeless (or should be).
Yes - it is possible. Silverlight 5 can access the Win32 API using PInvoke (platform invocation). The Silverlight application must be a trusted application.
Here's an example (there are lots of others, Google it):
http://blogs.msdn.com/b/silverlight_sdk/archive/2011/09/27/pinvoke-in-silverlight5-and-net-framework.aspx

Use System.Diagnostics in windows store application [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What’s the equivalent of the System.Diagnostic.Process on WinRT (C#)?
I use System.Diagnostics namespace for working with process functions in windows forms application.
Now I want to know is there any possible way so that I can use this function in windows store application?
Thanks in advance
I would think that they are not going to work. Looking at MSDN, it contains all the entities in the System.Diagnostics namespace that are available to Windows Store applications. If the method/class is not listed in this, then you can't use it. I would expect the code to not even be present in the framework that is used by these apps to prevent using them via introspection.
It's most likely that even if you could invoke the methods, you would find that they would fail due to security blocks that have been put in place to prevent Windows Store apps from interacting with the desktop.

How to communicate between processes? [duplicate]

This question already has answers here:
What is the best choice for .NET inter-process communication? [closed]
(8 answers)
Closed 6 years ago.
I can come up only with serialization, using of WCF, etc.
But is there the standard common way for communication between 2 processes in .Net?
UPDATE: What I actually mean how to communicate between 2 processes locally when I do not need to use WCF, Remoting and network at all. Are there some ways of doing it? And I am interesting in more elegant ways than storing data to HDD or to database.
With no other information, I would suggest using WCF with a named pipes configuration:
What is the best choice for .NET inter-process communication?
You can also look at .NET Remoting. But for all intents and purposes you shouldn't be using it unless you have explicit requirements that are satisfied by remoting like...in-process, cross-appdomain communication.
I would just look at WCF's NetNamedPipeBinding. It sounds like it's exactly what you want: http://www.codeproject.com/KB/WCF/wcfipcsample.aspx
Also it seems this question has already been answered:
Interprocess communication for Windows in C# (.NET 2.0)
C# - WCF - inter-process communication

What to use to make two .net programs transfer information [duplicate]

This question already has answers here:
What is the best choice for .NET inter-process communication? [closed]
(8 answers)
Closed 9 years ago.
I currently have two programs that need to comunicate one with another. It doesn't have to be something complicated, it's just passing data from one to another, all very simple. I was thinking of using .net remoting, but I've heard there's a new thing WCF. Should I go for the .net remoting or try WCF? Or is there something simpler to use?
edit: Both applications are simple, I don't want to have anything to do with IIS, services and such.
Thanks
use WCF with named pipes binding, here you can find useful examples
The magic phrase is "inter-process communication". Then you'll be able to find answers like this.
WCF has a bit of a learning curve, but it's a very powerful communication framework. If you have some time to learn it, I'd recommend that over .NET remoting.
If you just need a super-simple mechanism, you could just write data to a file, then read it from the other program (assuming same machine). If it has to go over the network, using a plain Socket in .NET isn't too bad.
I've used .Net remoting for this in the past, and its worked very well for me. Its very simple and straightforward for something like you describe.
If you look into WCF now, I really don't think you would regret later. WCF is great and useful for this purpose.
If you want something really simple, just put the data in a database or a file.

Categories