StructLayout(LayoutKind.Explicit, Size = 20, Pack = 4)] public struct SHQUERYRBINFO { [FieldOffset(0)] public int cbSize; [FieldOffset(4)] public long i64Size; [FieldOffset(12)] public long i64NumItems; } [DllImport("shell32.dll")] static extern int SHQueryRecycleBin(string pszRootPath, ref SHQUERYRBINFO pSHQueryRBInfo); public static int GetCount() { SHQUERYRBINFO sqrbi = new SHQUERYRBINFO(); sqrbi.cbSize = Marshal.SizeOf(typeof(SHQUERYRBINFO)); int hResult = SHQueryRecycleBin(String.Empty, ref sqrbi); if (hResult == 0) { return (int)sqrbi.i64NumItems; } return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)