可以用WinINet里的函索来实现。<br>清除Cookies,可以用以下函数:<br>procedure TMainForm.DeleteCooikes();<br>var<br> lpEntryInfo: PInternetCacheEntryInfo;<br> hHistoryDir: LongWord;<br> dwEntrySize: LongWord;<br> dwLastError: LongWord;<br>begin<br> Screen.Cursor := crHourGlass;<br> try<br> dwEntrySize := 0;<br> FindFirstUrlCacheEntry(nil, TInternetCacheEntryInfo(nil^), dwEntrySize);<br> GetMem(lpEntryInfo, dwEntrySize);<br> try<br> hHistoryDir := FindFirstUrlCacheEntry(nil, lpEntryInfo^, dwEntrySize);<br> if (hHistoryDir <> 0) then<br> if lpEntryInfo^.CacheEntryType = (lpEntryInfo^.CacheEntryType or COOKIE_CACHE_ENTRY) then<br> DeleteUrlCacheEntry( lpEntryInfo^.lpszSourceUrlName );<br> finally<br> DeleteUrlCacheEntry( lpEntryInfo^.lpszSourceUrlName );<br> end;<br><br> repeat<br> dwEntrySize := 0;<br> FindNextUrlCacheEntry(hHistoryDir, TInternetCacheEntryInfo(nil^), dwEntrySize);<br> dwLastError := GetLastError();<br><br> if (GetLastError = ERROR_INSUFFICIENT_BUFFER) then<br> begin<br> GetMem(lpEntryInfo, dwEntrySize);<br> try<br> if (FindNextUrlCacheEntry(hHistoryDir, lpEntryInfo^, dwEntrySize)) then<br> if (lpEntryInfo^.CacheEntryType = (lpEntryInfo^.CacheEntryType or COOKIE_CACHE_ENTRY)) then<br> DeleteUrlCacheEntry( lpEntryInfo^.lpszSourceUrlName );<br> finally<br> FreeMem(lpEntryInfo);<br> end;<br> end;<br> until ((dwLastError = ERROR_NO_MORE_ITEMS) or (dwLastError = ERROR_INVALID_PARAMETER));<br> finally<br> Screen.Cursor := crDefault;<br> end;<br>end;<br><br>