Deleting Internet Files

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Deleting Internet Files as PDF for free.

More details

  • Words: 232
  • Pages: 2
#include <wininet.h> #include <stdio.h> // // delete all files in the temporary internet files folder // // note that you can specify what not to delete by testing entry type // in code below, cookie entries are not deleted // [see if (!(lpcacheentry->cacheentrytype & cookie_cache_entry))] // int main() { bool bresult = false; bool bdone = false; lpinternet_cache_entry_info lpcacheentry = null; dword dwtrysize, dwentrysize = 4096; // start buffer size handle hcachedir = null; dword dwerror = error_insufficient_buffer; do { switch (dwerror) { // need a bigger buffer case error_insufficient_buffer: delete [] lpcacheentry; lpcacheentry = (lpinternet_cache_entry_info) new char[dwentrysize]; lpcacheentry->dwstructsize = dwentrysize; dwtrysize = dwentrysize; bool bsuccess; if (hcachedir == null)

&dwtrysize);

bsuccess = (hcachedir = findfirsturlcacheentry(null, lpcacheentry, &dwtrysize)) != null; else bsuccess = findnexturlcacheentry(hcachedir, lpcacheentry, if (bsuccess) dwerror = error_success; else { dwerror = getlasterror(); dwentrysize = dwtrysize; // use new size returned } break; // we are done case error_no_more_items: bdone = true; bresult = true; break; // we have got an entry case error_success:

// don't delete cookie entry if (!(lpcacheentry->cacheentrytype & cookie_cache_entry)) deleteurlcacheentry(lpcacheentry->lpszsourceurlname); // get ready for next entry dwtrysize = dwentrysize; if (findnexturlcacheentry(hcachedir, lpcacheentry, &dwtrysize)) dwerror = error_success; else { dwerror = getlasterror(); dwentrysize = dwtrysize; // use new size returned } break; // unknown error default: bdone = true; break; } if (bdone) { delete [] lpcacheentry; if (hcachedir) findcloseurlcache(hcachedir);

}

} } while (!bdone); return bresult;

Related Documents

Deleting Internet Files
November 2019 6
Deleting Scraps
October 2019 11
Deleting Oracle Sid
May 2020 7
Deleting A Record
November 2019 11
Files
November 2019 41
Files
May 2020 27