C#で他のプロセスを実行する。
http://jeanne.wankuma.com/tips/process/waitforexit.htmlから。
// IEの実行形式ファイルの在り処 string filepath = "C:/Program Files/Internet Explorer/"; string filename = "IEXPLORE.EXE"; // IEを指定して実行 Process hProcess = Process.Start(filepath + filename); // 終了するまで待機することを決定 hProcess.WaitForExit(); // 終了表示 System.Console.WriteLine(filename + "が終了しました。"); // 不要なオブジェクトの破棄を保証 hProcess.Close(); hProcess.Dispose();
ProcessStartInfoオブジェクトを使えば、プロセスの実行で細かい情報を与えることもできます?
ProcessStartInfo startInfo = new ProcessStartInfo(filepath + filename); // IEを指定して実行 Process hProcess = Process.Start(startInfo);