Wait for process to end async and then call a function within the main form
问题 I'm coding an editor for a game with C#. My programm openes as .txt File by starting a notepad.exe process. If that process exits, I want to call a function within the main form (to update the textbox). Here's what I'm doing so far: void OpenTextEditor(TreeNode node) { Process editor = new Process(); editor.StartInfo.WorkingDirectory = "%WINDIR%"; editor.StartInfo.FileName = "notepad.exe"; var txtfilelocation = GetRealPathByNode(node); var txtfile = File.ReadAllText(txtfilelocation,Encoding