C#程序调用GAMS

参照网址:http://chentserver.uwaterloo.ca/aelkamel/che720/che725-process-optimization/GAMS-tutorials/erwin/GAMS%20and%20other%20applications.htm

http://interfaces.gams-software.com/doku.php?id=env:executing_gams_from_other_environments


void RunGamsModel()
{
Process p = new Process();
p.StartInfo.FileName = @"F:\Program Files\GAMS23.3\gams.exe";
p.StartInfo.WorkingDirectory = @"F:\C#-GAMS\CSGAMS\CSGAMS\bin\Debug\gamsprogram";
p.StartInfo.Arguments = "\"" + @"F:\C#-GAMS\CSGAMS\CSGAMS\bin\Debug\gamsprogram\Untitled_1.gms" + "\" LO=0 --runid=" + "0";
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
p.WaitForExit();
MessageBox.Show("");
}

你可能感兴趣的:(C#)