ActiveX programınzı internet explorer'a zorla update ettirme

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
Kullanıcı avatarı
AliZairov
Üye
Mesajlar: 341
Kayıt: 06 Nis 2012 03:09
Konum: Azerbaycan, Bakü
İletişim:

Re: ActiveX şeklindeki programınızı nasıl update ediyorsunuz

Mesaj gönderen AliZairov »

Merhaba. Çerezleri silin deneyin.

Kod: Tümünü seç

uses WinINet, ComObj;

procedure ClearCache(RemCookies: boolean);
 var
 lpEntryInfo: PInternetCacheEntryInfo;
 hCacheDir: LongWord (*Handle*);
 dwEntrySize, dwLastError: LongWord;
 begin
 //Get size of first entry in dwEntrySize
 dwEntrySize := 0;
 FindFirstUrlCacheEntry(nil, TInternetCacheEntryInfo(nil^), dwEntrySize);

 //Create structure that can hold entry
 GetMem(lpEntryInfo, dwEntrySize);
 try
 //Get first cache entry and handle to retrieve next entry, output url
 hCacheDir := FindFirstUrlCacheEntry(nil, lpEntryInfo^, dwEntrySize);
 if hCacheDir = 0 then
 exit;

 if (hCacheDir <> 0) and
 ((lpEntryInfo^.CacheEntryType and NORMAL_CACHE_ENTRY) = NORMAL_CACHE_ENTRY) then
 begin
 if ((lpEntryInfo^.CacheEntryType and COOKIE_CACHE_ENTRY) = 0) or RemCookies then
 begin
 if FileExists(string(lpEntryInfo^.lpszLocalFileName)) then
 DeleteFile(string(lpEntryInfo^.lpszLocalFileName)) ; //delete file

 DeleteUrlCacheEntry(lpEntryInfo^.lpszSourceUrlName );
 end;
 end;
 finally
 //free structure
 FreeMem(lpEntryInfo);
 end;

 //retrieve all subsequent entries
 repeat
 dwEntrySize := 0;
 FindNextUrlCacheEntry(hCacheDir, TInternetCacheEntryInfo(nil^), dwEntrySize);
 dwLastError := GetLastError();

 if dwLastError = ERROR_INSUFFICIENT_BUFFER then begin
 GetMem(lpEntryInfo, dwEntrySize);
 try
 if FindNextUrlCacheEntry(hCacheDir, lpEntryInfo^, dwEntrySize) then begin
 if ((lpEntryInfo^.CacheEntryType and NORMAL_CACHE_ENTRY) = NORMAL_CACHE_ENTRY) then
 begin
 if ((lpEntryInfo^.CacheEntryType and COOKIE_CACHE_ENTRY) = 0) or RemCookies then
 begin
 if FileExists(string(lpEntryInfo^.lpszLocalFileName)) then
 DeleteFile(string(lpEntryInfo^.lpszLocalFileName)) ; //delete file

 DeleteUrlCacheEntry(lpEntryInfo^.lpszSourceUrlName );
 end;
 end;
 end else
 exit;
 finally
 FreeMem(lpEntryInfo);
 end;
 end else
 exit;
 until dwLastError = ERROR_NO_MORE_ITEMS;
 end;

Kullanımı:
ClearCache(True);
Cevapla