Currently I\'m using the following function
file.Delete();
But how can I use this function to send a file to the recycle bin instead of jus
There is built-in library for this .
First add reference Microsoft.VisualBasic Then add this code :
FileSystem.DeleteFile(path_of_the_file,
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.RecycleOption.SendToRecycleBin,
Microsoft.VisualBasic.FileIO.UICancelOption.ThrowException);
I have found this here .