各位大俠,我想用C#呼叫ANSYS后臺自動運行,程式代碼為:
startInfo.WorkingDirectory = "e:\\Input.txt";
startInfo.Arguments = "-b -p ane3fl -i e:\\Input.txt -o d:\\Output.dat";//啟動引數,-b表示后臺運行程式,-p-i Input.mac表示輸入檔案的檔案名,-o Output.dat表示輸出檔案的檔案名
//startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName="D:\\ANSYS 18.0\\ANSYS Inc\\v180\\ANSYS\\bin\\winx64\\launcher.exe";
Process proAnsys = Process.Start(startInfo);
if (proAnsys != null)
{
proAnsys.WaitForExit();
}
但是運行不了,并且修改不了ANSYS的作業路徑,startInfo.WorkingDirectory = "e:\\Input.txt";這句話好像沒用。
uj5u.com熱心網友回復:
作業路徑應該是個目錄,e:\\Input.txt這玩意看上去是個檔案啊uj5u.com熱心網友回復:
去掉 .txt 看看轉載請註明出處,本文鏈接:https://www.uj5u.com/net/131117.html
標籤:C#
