无法删除项目? [英] cannot be deleted project ?

查看:89
本文介绍了无法删除项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我有C#项目,当有人删除项目的exe(project.exe)时,我不想被删除.
当有人尝试删除时,我可以做project.exe的可见false吗?
或者当有人试图删除时,我可以给MessageBox(您不能删除exe")吗?
它看起来像触发器(而不是删除触发器等).

Hello to everybody
I have C# project and when somebody delete project''s exe(project.exe) I dont wanted to be deleted.
Can I do project.exe''s visible false when when somebody trying to delete ?
Or can I give MessageBox("you cannot delete exe") when somebody trying to delete ?
It looks like triggers (instead of delete triggers etc.).

推荐答案

实现此目的的唯一方法是拥有另一个监视"project.exe"的程序.在Windows中,您不能删除正在运行的可执行文件,如果它没有运行,它也无能为力.由于程序未运行,因此删除后没有任何事件发送给该程序,因此没有地方可将事件发送给该程序.

但是,即使您编写了第二个程序,也要停止运行该程序并将其删除,这是一项微不足道的任务.您所要求的内容对于任何正常使用来说都太不切实际了(我唯一看到过类似行为的地方就是恶意软件,因此如果我不进一步详细介绍,您将不得不为我辩解) .
The only way to accomplish this is to have a second program that monitors "project.exe". In Windows, you can''t delete an executable that''s running, and if it isn''t running it can''t do anything. There are no events sent to a program upon it''s deletion because it isn''t running, so there is no place to send events to.

But even if you wrote a second program, it''s a trivial task to stop that one from running and delete it anyways. What you''re asking for is simply too impractical for any normal use (the only place I''ve seen similar behavior is malware, so you''ll have to excuse me if I won''t go into any more details).


您是该软件的所有者,而不是用户的计算机.因此,让用户决定保留还是删除程序.软件.如果用户无法删除您的程序,则可以对您提起诉讼.

在这里阅读更多类似案例的详细信息..

http://en.wikipedia.org/wiki/Sony_BMG_copy_protection_rootkit_scandal [
You own the software ..not the user''s computer..So let the user decide whether to keep your program or delete it..You should not force him to keep your software. The user can file a law suit against you if he is unable to delete your program.

Read more details here related a similar case ..

http://en.wikipedia.org/wiki/Sony_BMG_copy_protection_rootkit_scandal[^]


这篇关于无法删除项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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