在单个流程实例中传递多项聚合. [英] Passing muliple agruments in single instance of process.

查看:62
本文介绍了在单个流程实例中传递多项聚合.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


//单击按钮,我正在编写以下代码.
//
System.Diagnostics.Process.Start("Myapplication.exe",Argument1);

如果单击按钮,将执行Myapplication.exe,并且将Argument1传递给它,对我来说效果很好.

查询: 如果再次单击按钮,我又得到了另一个我不希望的Myapplication.exe实例,我想在Myapplication.exe的第一个实例中传递Argument2.
你能推荐一种方法吗?

在此先谢谢您.

Hello Guys,


//On a click of button,i am writing the below code.
//
System.Diagnostics.Process.Start("Myapplication.exe", Argument1);

if i click the button, Myapplication.exe gets executed and i am passing Argument1 to it,it works fine for me.

Query: if i second time click button,again i get another instance of Myapplication.exe that i do not want,i want to pass Argument2 in first instance of Myapplication.exe.
can you please suggets a way to do it.

Thanks in advance.

推荐答案

您的问题不清楚或让我们知道您要做什么?

从您现有的方法来看,这是不可能的,因为当您第一次调用 Myapplication.exe 时,它的第一个参数已成功完成,并且该过程不再可用,因此您无法使用该过程. br/>
即使您的应用程序尚未完成执行,您也无法将参数再次传递给同一参数,因为参数在Sub Main()中传递,而Sub Main()在启动该过程时仅被调用一次.

让我们知道您要通过传递第二个参数来实现的目标.

问候
Rushikesh Joshi
Your Question is not clear or let us know what are you trying to do?

From your existing approach it will not be possible as when you first time calls Myapplication.exe then its taking first argument and process is completing successfully and that process is no longer available so you cant use that process.

Even, if your application has not completed execution you can not pass argument again to same process as Argument is getting passed in Sub Main() which being called only once at starting the process.

Let us know what you are trying to achieve by passing second argument.

Regards
Rushikesh Joshi


您似乎正在尝试使用命令行参数将多个参数传递给应用程序的单个实例.
阅读此MSDN文章 [
It appears that you are trying to pass multiple arguments to a single instance of your application using command line arguments.
Read this MSDN article[^] to see how this is done.


这篇关于在单个流程实例中传递多项聚合.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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