如何将数据从子应用程序传递到父应用程序? [英] How to pass data from child Application to parent Application?

查看:114
本文介绍了如何将数据从子应用程序传递到父应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的解决方案中有两个应用程序,我需要在这两个exe之间进行通信。

应用程序1:Windows窗体。

应用程序2:WPF。



应用程序2从应用程序1(Windows窗体)启动,应用程序2包含两个按钮(允许和取消)。在单击允许按钮时,我们正在更新布尔值。我们需要应用程序1中的布尔值。请找到以下代码。

I have two Applications in my solution, i need to communicate between these two exe.
Application 1 : Windows Form.
Application 2 : WPF.

Application 2 launched from Application 1(Windows Form),Application 2 contains two buttons(Allow and Cancel). On Clicking Allow Button,we are updating Boolean value.We need the Boolean value in Application 1.Please find the below code.

ProcessStartInfo startInfo = new ProcessStartInfo(" Application 2.exe" )); $
startInfo.UseShellExecute = true;

startInfo.Verb =" runas";

startInfo.CreateNoWindow = false;

var sinfo = System.Diagnostics.Process.Start(startInfo);
$
sinfo.WaitForExit();

======== =======
$
这里等待应用程序2的bool值
$
===============


请分享代码以从其他应用程序获取数据。

ProcessStartInfo startInfo = new ProcessStartInfo("Application 2.exe"));
startInfo.UseShellExecute = true;
startInfo.Verb = "runas";
startInfo.CreateNoWindow = false;
var sinfo = System.Diagnostics.Process.Start(startInfo);
sinfo.WaitForExit();
===============
Here waiting for the bool value from Application 2
===============

Please share the code to get the data from other Application.

推荐答案

您好,

查看
命名管道

https://stackoverflow.com/que stions / 13806153 / example-of-named-pipes


这篇关于如何将数据从子应用程序传递到父应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆