|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to control a process launched with Process.start(string)I launch an application using this method:
Process.Start("C:\\Documents and Settings\\Ramón\\Desktop\\C#___Bluegurads_v3_18_03_05\\Bluetime_1\\BlueTime\\Debug\\BlueTime.exe"); but then I do not know how to wait until it is finished. anybody knows how to do it? Thanks, Ramón private void DownloadFirmware(object sender)
{ string fnName = "DownloadFirmware"; string FileName = Globals.ApplicationPath + "\\SerDL.exe"; // Look for SerDl if (File.Exists(FileName) == false) { MessageBox.Show(string.Format("File '{0}' was not found", FileName)); return; } if (sender == cmdInstallFirmware) { try { System.Diagnostics.Process SerDL = new System.Diagnostics.Process(); SerDL.StartInfo.FileName = FileName; SerDL.StartInfo.WorkingDirectory =Globals.ApplicationPath + "\\Firmware"; SerDL.StartInfo.UseShellExecute = false; SerDL.Start(); SerDL.WaitForExit(); } catch (Exception f) { Log.Error(GetType(), fnName, f); MessageBox.Show(@"Exception occurred while attempting to run SerDl.exe "+f.Message, "Error"); } } }
Other interesting topics
Access to instance objects in different classes
Errors in services. How should you handle them? CAS and multiple permissions A plea for the reinstatement of IDL C# and ADO.Net - Cheap Question! adding local varialbes - String? Making a fully functional Textbox ASPX to get the HTML form value OleDbCommand Parameters Collection DatetTimePicker |
|||||||||||||||||||||||