Send file to Recycle Bin instead of deleting permanently
-
In a C# application: How to delete a file in a non-permanent manner by sending it to Recycle Bin, instead of deleting it permanently? I want to do it so that the user will have the option of restoring the file from Recycle Bin if he wants to at a later time.
-
In a C# application: How to delete a file in a non-permanent manner by sending it to Recycle Bin, instead of deleting it permanently? I want to do it so that the user will have the option of restoring the file from Recycle Bin if he wants to at a later time.
-
Thanks for reply. But, is it possible to get the "physical address" of the Recycle Bin "virtual" folder in the C# code itself, because in that I can use the File.Move method to move the file to that folder. This may be equivalent to deleting to the Recycle Bin.
-
Thanks for reply. But, is it possible to get the "physical address" of the Recycle Bin "virtual" folder in the C# code itself, because in that I can use the File.Move method to move the file to that folder. This may be equivalent to deleting to the Recycle Bin.
normally it is located under C:\RECYCLER\ + Some string that looks like an SID. But i think it is not recomendet to move files directly into this folder since you would override the maximum size of the recycler. This could lead to conditions where the recycler grows until it uses all the space of the HD. But since the recylcer is only available on windows you could use the shell functions. you app would work only on windows anyway. /cadi 24 hours is not enough