C# 一个进程调用另外一个进程并传入参数

来源:互联网 发布:ubuntu 添加桌面图标 编辑:程序博客网 时间:2024/05/01 21:15

1,目的如图;

2,实现代码:

<span style="white-space:pre"></span>//进程所在文件夹                ProcessStartInfo startInfo = new ProcessStartInfo(Settings.Default.texturePath + @"TexturePacker.exe");                //重定向输出                 startInfo.RedirectStandardOutput = true;                //错误输出                startInfo.RedirectStandardError = true;                startInfo.UseShellExecute = false;                //进程不打开窗口                startInfo.CreateNoWindow = true;                //打开进程的时候附带的命令行                startInfo.Arguments = @"--data " + Settings.Default.imagePath + @"\result\" + count + @".plist --format cocos2d --sheet " + Settings.Default.imagePath + @"\result\" + count + ".png --size-constraints POT --dither-fs-alpha " + " " + Settings.Default.imagePath + @"\temp" + count;                //开启进程,并读取信息                result.msg=Process.Start(startInfo).StandardError.ReadToEnd();


0 0
原创粉丝点击