未调用Process.Exited事件 [英] Process.Exited event not called

查看:115
本文介绍了未调用Process.Exited事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试程序,该程序创建一个Process类,将.Exited事件处理程序设置为p1.exited()方法.

我将FileName设置为iexplore.exe.我在对象上调用Start().关闭Windows资源管理器时,将调用p1.exited()方法.

当我将FileName设置为word.lnk时,它永远不会命中exited()方法.

当我将FileName设置为实际的.exe时,将点击exited()方法.

我最初打算将其发布为问题,但是在格式化问题时我提出了解决方案.

因此,万一其他人遇到了这个问题,我也已经解决了.

I have a test program that creates a Process class, sets the .Exited event handler to the p1.exited() method.

I set the FileName to iexplore.exe. I call Start() on the object. When I close Windows Explorer, the p1.exited() method is called.

When I set the FileName to word.lnk, it never hits the exited() method.

When I set the FileName to the actual .exe, the exited() method is hit.

I was initially going to post this as a question, but while formatting the question I came up with the solution.

So, in case someone else has this problem, I''ve also solved it.

推荐答案

我实际上回答了我自己的问题,但以为我会发布它反正. ;)
I actually answered my own question, but thought I''d post it anyway. ;)


这篇关于未调用Process.Exited事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆