I've taken the source for SHFileOperation from
www.PInvoke.net
and it works as expected. The source below works properly:
InteropSHFileOperation fo = new InteropSHFileOperation();
fo.wFunc = InteropSHFileOperation.FO_Func.FO_DELETE;
fo.fFlags.FOF_ALLOWUNDO = true;
fo.pFrom = @"C:\test.txt";
if (fo.Execute())
{
MessageBox.Show("test.txt recycled");
}
else
{
MessageBox.Show("Unable to recycle test.txt");
}
Can you post some code, so I can look at it?
Willem van Rumpt
JezB wrote:
Cannot get the damned thing to work ...grrr
"JezB" <je***********@blueyonder.co.uk> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
In c# code how do I delete a file while ensuring it goes into the recycle
bin for possible recovery ?