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

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();


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章