Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.).
Posted
Updated 5-Aug-12 21:38pm
v11
Comments
[no name] 3-Aug-12 9:40am    
This makes no sense. You are deleting the file but do not want it deleted?
Solution is to not delete the file.
[no name] 6-Aug-12 4:03am    
you are right ;not to delete the file can be solution.
But my question different :is there a way to make my question
bbirajdar 3-Aug-12 9:42am    
Even if it is deleted, then you can recover it from recycle bin.. So not to worry
[no name] 6-Aug-12 4:00am    
if I shift-delete ? what will happen ?
bbirajdar 6-Aug-12 4:48am    
Better way you should use Windows + R > cmd 'Enter' > FORMAT D: .... Its better then Shift+Delete

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[^]
 
Share this answer
 
Comments
[no name] 8-Aug-12 3:10am    
Not for other users İt just for me
I dont want anybody to delete my project...
and if delete just make visible false and let him happy :)))
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).
 
Share this answer
 
Comments
[no name] 3-Aug-12 18:37pm    
i really want to learn C#`s deepness .ok no problem if you dont want to get into details any more

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900