Hi,
I need to Move a file to recycle bin in .net 2003
I added microsft.visualbasic.runtime dll from refrence, but i could not able to get filesystem.deletedirectory, So what to do..Can any one help me?
Hi,
I need to Move a file to recycle bin in .net 2003
I added microsft.visualbasic.runtime dll from refrence, but i could not able to get filesystem.deletedirectory, So what to do..Can any one help me?
This might help you. Looks like you need to either add a reference to Microsoft.VisualBasic.dll or use P/Invoke.
I found this, don't know if it works, but it's worth a shot.
using Microsoft.VisualBasic;
string path = @"c:\myfile.txt";
FileIO.FileSystem.DeleteDirectory(path, FileIO.UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
EDIT: Wise words from Nifle: Just remember to add a reference to Microsoft.VisualBasic.dll
Have you got a
using Microsoft.VisualBasic.FileIO;
at the top of your page?