Click here to Skip to main content
15,850,299 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to use scheduler to delete any item?

i want to bulid an application that has soft deletion facality, it means deletion of resource is done after one our.

so i am looking to use windows schedular to implement this but i don't know how to use it.

Thanks & regards

Pawan Tiwari
Posted
Updated 22-Aug-11 5:14am
v3
Comments
Manfred Rudolf Bihy 22-Aug-11 9:36am    
Please enhance your question with more details.
pawantiwari52 22-Aug-11 10:15am    
now you got it what i am actually trying to say
Oludayo Alli 22-Aug-11 9:44am    
This is not a question, try to improve it!

1 solution

I don't think it's that simple - you would have to hook into the windows file delete first to prevent the "real" delete function. I know it is possible, but it isn't a job I'd want a beginner to get into - it would be far too easy to mess up completely!

If you must, then google for "Windows Hook C#" and "Hook File Delete" and start reading - but you have quite a bit of work to do first.

The actual "don't do it for real for an hour" is pretty simple in comparison!
 
Share this answer
 
Comments
pawantiwari52 22-Aug-11 11:21am    
it is same as the gmail offers to their user ,it never directly delete the mail on the user's click.
that same thing i would like to add in my application
OriginalGriff 22-Aug-11 11:57am    
Then move it, either to a different database table / folder (or just change it's status to deleted if it is in a DB) and timestamp it as "to be deleted at or after"
Then have a service which run continually, sleeping for 60 seconds or so at a time, checking if any files are past their sell-by date.

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