Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>at my old projects i was readed captcha from web. i done this with embedded web browser component cache procedures. so if you can read temporary internet files from your code you can read the image data from cache. i added a simple code to below,</p> <p>the GetCachedFileFromURL and ClearAllEntries functions is declarated in TEmbeddedWebBrowser unit. i was used only my copied code in my solution for lower exe size. but you can use component updated source. the component is open source.</p> <pre><code>uses WinInet; function GetCachedFileFromURL(strUL: string; var strLocalFile: string): Boolean; var lpEntryInfo: PInternetCacheEntryInfo; hCacheDir: LongWord; dwEntrySize: LongWord; dwLastError: LongWord; begin Result := False; dwEntrySize := 0; // Begin the enumeration of the Internet cache. FindFirstUrlCacheEntry(nil, TInternetCacheEntryInfo(nil^), dwEntrySize); GetMem(lpEntryInfo, dwEntrySize); hCacheDir := FindFirstUrlCacheEntry(nil, lpEntryInfo^, dwEntrySize); if (hCacheDir &lt;&gt; 0) and (strUL = lpEntryInfo^.lpszSourceUrlName) then begin strLocalFile := lpEntryInfo^.lpszLocalFileName; Result := True; end; FreeMem(lpEntryInfo); if Result = False then repeat dwEntrySize := 0; // Retrieves the next cache group in a cache group enumeration FindNextUrlCacheEntry(hCacheDir, TInternetCacheEntryInfo(nil^), dwEntrySize); dwLastError := GetLastError(); if (GetLastError = ERROR_INSUFFICIENT_BUFFER) then begin GetMem(lpEntryInfo, dwEntrySize); if (FindNextUrlCacheEntry(hCacheDir, lpEntryInfo^, dwEntrySize)) then begin if strUL = lpEntryInfo^.lpszSourceUrlName then begin strLocalFile := lpEntryInfo^.lpszLocalFileName; Result := True; Break; end; end; FreeMem(lpEntryInfo); end; until (dwLastError = ERROR_NO_MORE_ITEMS); end; procedure TForm1.ClearCache(); begin SearchPattern := spAll; ClearAllEntries; end; </code></pre> <p>usage</p> <pre><code>procedure TForm1.Button1Click(Sender: TObject); var fname:string; jpImg:TJPEGImage; begin ClearCache; try jpImg:=TJPEGImage.Create; GetCachedFileFromURL('https://ebildirge.ssk.gov.tr/WPEB/PG',fname); jpImg.LoadFromFile(fname); finally FreeAndNil(jpgImg); end; end; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload