首页 新闻 赞助 找找看

Process.Exited 提前响应!

1
悬赏园豆:80 [待解决问题]
private void unkeydrave(string patch)
{

Process p
= new Process();
p.EnableRaisingEvents
= true;
p.StartInfo.FileName
= "C:\\WINDOWS\\system32\\GECSP20264\\uninst.exe";
p.Exited
+= new EventHandler(P_Exited);
p.Start();
td.Suspend();


}
private void P_Exited(object sender, System.EventArgs e)
{
Process pr
= new Process();
pr.StartInfo.FileName
= "Regsvr32.exe";
pr.StartInfo.Arguments
= "/s /u JITDSign.ocx";
pr.Start();
//反注册成功
DirectoryInfo di = new DirectoryInfo(Environment.SystemDirectory);
foreach (FileInfo tempfile in di.GetFiles())
{
if (tempfile.Name == "JITDSign.ocx" | tempfile.Name == "JITK_PDI.dll" | tempfile.Name == "JITKServiceDLLP.dll" | tempfile.Name == "JITK_CDI.dll" | tempfile.Name == "JITK_EDI.dll" | tempfile.Name == "JITKCAPI.dll" | tempfile.Name == "JITK_UI.dll" | tempfile.Name == "JITK_CRYPT.dll" | tempfile.Name == "JITKDNWatcher.exe")
{
tempfile.Delete();
td.Resume();
}
}
td.Abort();
}

Exited提前响应,而且怎么自动生成private void P_Exited(object sender, System.EventArgs e)

幽梦影的主页 幽梦影 | 初学一级 | 园豆:125
提问于:2011-03-09 16:03
< >
分享
所有回答(1)
0
2012 | 园豆:21228 (高人七级) | 2011-03-09 17:50
能在详细点吗,那个我之前看了,弄不懂才问的
支持(0) 反对(0) 幽梦影 | 园豆:125 (初学一级) | 2011-03-10 15:52
EnableRaisingEvents 需要设置,以上的代码就可以工作了,你的问题是什么地方,td.Abort这些是什么内容?
看你这个程序好像是卸载的操作,使用VS自带的打包,只要标注为组件的库会自动清理; 特殊情况需要自己处理的,在卸载动作处加个程序执行如Regsvr32也可以【VS带的打包比较简单】
支持(0) 反对(0) 2012 | 园豆:21228 (高人七级) | 2011-03-10 17:48
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册