Reputation: 1799
I have two applications developed in WPF(c#) which are independent on each other. Suppose Project A and B. they are developed separately. i have connected those projects with the Button in project A, on click of that button i am starting project B with Process.start();
now i need to pass String (login) parameter to the another application (B) so user dont need to login again.
I have already seen the Command line argument passing but i dont want to use them.
also Application.Current.Properties["parameterStringID"]
is not useful because i have different app.config for A and B
Is there any way to do this?
Upvotes: 3
Views: 1995
Reputation: 7197
do all your applications have similar login method?
make a AviCompany Login windows service
.
the service will be also a WCF service
that provides method "Login"
see my chart
https://www.lucidchart.com/documents/view/410f-6e48-52c16052-a63b-4a5e0a009f85
Upvotes: 1
Reputation: 7277
You can send commandline arguments to your application like this.
var applicationPath = "Path to application B exe";
var process = new Process();
process.StartInfo = new ProcessStartInfo(applicationExePath);
process.Arguments = "/login=abc /password=def";
process.Start();
And in your ApplicationB start, handle commandline arguments.
Upvotes: 2
Reputation: 16119
I've solved this in the past by using either anonymous or named pipes, .NET has quite good support for them. There are a few good articles about them on the MSDN site.
Upvotes: 1