我有以下内容:
class Program {
static void Main(string[] args) {
Process pr;
pr = new Process();
pr.StartInfo = new ProcessStartInfo(@"notepad.exe");
pr.Disposed += new EventHandler(YouClosedNotePad);
pr.Start();
Console.WriteLine("press [enter] to exit");
Console.ReadLine();
}
static void YouClosedNotePad(object sender, EventArgs e) {
Console.WriteLine("thanks for closing notepad");
}
}
当我关闭记事本时,我没有收到我希望收到的消息 - 如何修改以使关闭记事本返回到控制台?