|
From: Morten L. <mor...@no...> - 2012-06-11 11:20:13
|
> Yes! At least I didn’t forget it. This mail should have an attachment, > but for sure here’s the source code: > ========== > using System.Diagnostics; > using System.IO; > > class Program > { > static void Main(string[] args) > { > ProcessStartInfo processStartInfo = > new ProcessStartInfo(@"gnuplot"); > //new ProcessStartInfo(@"C:\Programme\gp460win32\binary\gnuplot.exe"); > processStartInfo.UseShellExecute = false; > processStartInfo.RedirectStandardInput = true; > > Process gpProc = new Process(); > gpProc.StartInfo = processStartInfo; > gpProc.Start(); > StreamWriter gpcommands = gpProc.StandardInput; > gpcommands.WriteLine("splot x+y"); > gpcommands.WriteLine("bind Close \"exit gnuplot\""); > //gpcommands.WriteLine("exit"); > gpProc.WaitForExit(); > } > } > ======== > I have just tried this code using gnuplot 4.6 in a .Net 4.0 project on Windows 7 machine, and I was not able to reproduce the problem. After the window was closed, execution returned to the main method. No hanging on WaitForExit. /Morten |