我想从我的C#代码调用exe,在调用exe后我的c#应用程序应该关闭imediatly。 [英] I want to invoke exe from my C# code, after invoking the exe my c# application should be closed imediatly.

查看:74
本文介绍了我想从我的C#代码调用exe,在调用exe后我的c#应用程序应该关闭imediatly。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想从我的c#代码中调用exe。使用下面的代码,我可以做到这一点。


             
myProcess.StartInfo.FileName = @"
C:\ MyApp\Setup.exe " ;;

                myProcess.StartInfo.UseShellExecute = true;

                myProcess.StartInfo.Verb =" runas";

                myProcess.StartInfo.CreateNoWindow = true;

                myProcess.Start();


但是我需要在exe文件调用和设置向导继续之后立即关闭我的应用程序(即c#app)。 


谢谢


K.Arivazhagan


解决方案

myProcess.StartInfo.FileName = @" C:\ MyApp\Setup.exe " ;;

myProcess.StartInfo.UseShellExecute = true;

myProcess.StartInfo.Verb =" runas";

myProcess.StartInfo.CreateNoWindow = true;

myProcess.Start();


Application.Current.Shutdown();


Hi,

I want to invoke the exe from my c# code . Using below code I can achieve this.

              myProcess.StartInfo.FileName = @"C:\MyApp\Setup.exe";
                myProcess.StartInfo.UseShellExecute = true;
                myProcess.StartInfo.Verb = "runas";
                myProcess.StartInfo.CreateNoWindow = true;
                myProcess.Start();

But I need to close my application (that is c# app) immediately after the exe file invocation and setup wizard should continues. 

Thanks

K.Arivazhagan

解决方案

myProcess.StartInfo.FileName = @"C:\MyApp\Setup.exe";
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.Verb = "runas";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();

Application.Current.Shutdown();


这篇关于我想从我的C#代码调用exe,在调用exe后我的c#应用程序应该关闭imediatly。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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