C#程序调用GAMS

来源:互联网 发布:p2p理财安全吗 知乎 编辑:程序博客网 时间:2024/05/01 21:00

参照网址: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("");
        }

原创粉丝点击