Empty Recycle Bin
28 June 2009
339 views
One Comment
Empty the Recycle Bin
Ths following code is used to empty the recycle bin using Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
The namespace we have to use is:
using System.Runtime.InteropServices; then create an enum for recylceflags like enum RecycleFlgs : uint { SHERB_NOCONFIRMATION = 0x00000001, SHERB_NOPROGRESSUI = 0x00000002, SHERB_NOSOUND = 0x00000004 } creating an extern [DllImport("Shell32.dll", CharSet = CharSet.Unicode)] static extern uint EmptyRecycleBin (IntPtr hwnd, string pszRootPath, RecycleFlgs dwFlags); Now the main function to call the above defined code public static void Main() { uint result = EmptyRecycleBin (IntPtr.Zero, null, 0); Console.WriteLine ("Result: {0}", result); }
Thanks and Regards
Meetu Choudhary
http://www.msdotnetmentor.com/
Popularity: 4%
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.


(1 votes, average: 4.00 out of 5)







Meetu great job
keep it up!
Leave your response!
You must be logged in to post a comment.