如何启动另一个winform-app并传递数据 [英] How to launch another winform-app and pass data

查看:148
本文介绍了如何启动另一个winform-app并传递数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我需要执行以下任务:

Hi I need to perform the following tasks :

1)从控制台应用程序启动Winfrm-app

1) Launch a Winfrm-app from a console app

2)从Console-app传递数据到launch-winform应用程序。

2) from Console-app pass data to the launched-winform app.

在启动winform时,是否必须完成控制台应用程序传递数据?

Is this has to be done that console app passes data when launches the winform?

3)在启动Winfrm应用程序完成任务后,将数据发送到控制台应用程序。

3) After the launched-Winfrm app completes task, send data to console app.

谢谢

推荐答案

取决于什么样的应用程序。 

Depends in what kind of application. 

在C#中,它在Program cs中更改Application.Run并添加一个接受重载参数的形式的构造函数。

In C# it change in Program cs the Application.Run and Add a Constructor in the form which accepts the overloaded arguments.

在VB中什么都不做,只在Load事件中使用它 

In VB do nothing but use this in the Load event 

If My.Application.CommandLineArgs.Count > 0 Then
            MessageBox.Show(My.Application.CommandLineArgs(0))  'first item 
End If


请注意我喜欢在VB中做同样的事情C#但是需要一些知识如何使事物可见和改变。

Be aware I prefer to do in VB the same as C# but that needs some knowledge how to make things visible and to change.


这篇关于如何启动另一个winform-app并传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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