首页 > 分享 > C# 调起外部程序并等待该程序结束后继续运行

C# 调起外部程序并等待该程序结束后继续运行

最新推荐文章于 2023-10-30 15:24:24 发布

Carpe_D1em 于 2019-01-21 08:30:04 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

public static void runScript(string fileName, string arguments)

{

Process p = new Process();

try

{

p.StartInfo.FileName = fileName;

p.StartInfo.Arguments = arguments;

p.StartInfo.UseShellExecute = false;

p.StartInfo.RedirectStandardInput = false;

p.StartInfo.RedirectStandardOutput = false;

p.StartInfo.RedirectStandardError = true;

p.StartInfo.CreateNoWindow = false;

p.Start();

p.WaitForExit();

}

finally

{

p.Close();

}

}

相关知识

分析下面的C#代码,该程序的运行结果是( ) int index=1; int[
小程序交流专区
神经网络与遗传算法融合的AI中国象棋程序源码分享
python 玫瑰花程序
C#桌面玫瑰花程序情人节玫瑰花礼物源码可以直接运行资源
input string was not in a correct
小程序App常见问题
以下程序段运行结束后,变量x的值为() x=2 y=4 do x=x*y y=y
C#:实现模拟花卉进化过程算法(带源代码)
findstr ’不是内部或外部命令,也不是可运行的程序

网址: C# 调起外部程序并等待该程序结束后继续运行 https://m.huajiangbk.com/newsview546563.html

所属分类:花卉
上一篇: 第三方App(或网页应用)接入微
下一篇: Android客户端 — nat