Ejemplo n.º 1
0
        private void Execute(FileInfo kplModelFile, FileInfo outputFile)
        {
            string  s         = settings.ToString();
            Process p         = new Process();
            var     startInfo = new ProcessStartInfo
            {
                UseShellExecute        = false,
                WorkingDirectory       = outputFile.Directory.FullName,
                FileName               = "kpw",
                Arguments              = string.Format("-s {0} {1} -o {2}-simulation-result.txt", kplModelFile.FullName, s, Path.GetFileNameWithoutExtension(kplModelFile.Name)),
                RedirectStandardOutput = true,
                RedirectStandardError  = true,
                CreateNoWindow         = true,
                WindowStyle            = ProcessWindowStyle.Hidden,
            };

            p.StartInfo = startInfo;
            p.Start();
            p.WaitForExit();
        }