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


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