请问如何编程删除windows2000的history?

解决方案 »

  1.   

    History is now history
    Dear Web Men:Is there some way of preventing pages from appearing on the History List?Thank you forwards,Oliver BerkeThe Web Men reply:The answer is in mostly in caching! Huh, you say? Bear with us.There are two history lists, session and global. The global history is the list displayed when a user brings up the History bar. These items represent sites visited across all sessions by that user and are taken from the user抯 Temporary Internet Files folder. To avoid having a URL added to this list, you can specify that the file should not be cached; hence, it won抰 be present in the Temporary Internet Files folder. Check out KB article Q234067, "HOWTO: Prevent Caching in Internet Explorer"  for information on how to avoid caching. A better solution is to have your Web administrator control browser settings through auto configuration files, and to then specify a value of zero for the "Day to keep pages in History" Internet option. That's not all! For those programmers among us, here's some code to clear the History cache programmatically. You can implement a Browser Helper Object (BHO) and clear the history after navigation if you so wish. See Q179230, "IEHelper-Attaching to Internet Explorer 4.0 using a Browser Helper Object"  for a? BHO sample#include <shlguid.h> // Needed for CLSID_CUrlHistory
    #include <urlhist.h> // Needed for IUrlHistoryStg2 and IID_IUrlHistoryStg2
    IUrlHistoryStg2* pHistory;?// We need this interface for clearing the history.
    牋牋牋?HRESULT hr;
    牋牋牋?DWORD cRef;
    牋牋牋?CoInitialize(NULL);
    牋牋牋?// Load the correct Class and request IUrlHistoryStg2
    牋牋牋?hr = CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC_SERVER,
    IID_IUrlHistoryStg2, reinterpret_cast<void **>(&pHistory));
    牋牋牋?if (SUCCEEDED(hr))
    牋牋牋?{
    牋牋牋牋 // Clear the IE History
    牋牋牋牋 hr = pHistory->ClearHistory();
    牋牋牋?}
    牋牋牋?// Release our reference to the 
    牋牋牋?cRef = pHistory->Release();
    牋牋牋?CoUninitialize();
    To avoid having your files added to the session history list, use location.replace to overwrite the current URL in history with the URL a user visits next. This functionality is most often requested because the Web developer does not want the user to go back to stale content. In this case, you can avoid content from being cached -- so even if the URL is present in the session history list, you can be assured that the data will be obtained from your server. Note the side effect: Without caching, there is a roundtrip to the server every time the page is requested, which may raise a performance issue for large files.
      

  2.   

    VC中实现历史记录的全面清除
    http://www.vckbase.com/document/viewdoc.asp?id=280