all groups > dotnet academic > november 2003 >
You're in the

dotnet academic

group:

Recycle Bin with C#


Recycle Bin with C# Andres
11/20/2003 12:52:54 PM
dotnet academic:
Does anyone know how to work with the Recycle Bin with C#?
I mean how to get the list of files that are in the
Recycle Bin, hoy to send a file there, how to recover the
files of the Recycle Bin, etc...

Re: Recycle Bin with C# rmorin NO[at]SPAM kbcafe.com
11/22/2003 12:15:37 PM
Sample
http://www.aspfree.com/articles/1352,1/articles.aspx

and you can always resort to an interop

enum RecycleFlags :uint
{
SHERB_NOCONFIRMATION = 0x00000001,
SHERB_NOPROGRESSUI = 0x00000002,
SHERB_NOSOUND = 0x00000004
}

[DllImport("Shell32.dll", CharSet = CharSet.Unicode)]
static extern uint SHEmptyRecycleBin(IntPtr hwnd, string pszRootPath,
RecycleFlags dwFlags);

[STAThread]
static void Main(string[] args)
{
uint result = SHEmptyRecycleBin(IntPtr.Zero, null, 0);
}

Hope this helps,

Randy
http://www.kbcafe.com

[quoted text, click to view]
AddThis Social Bookmark Button