Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:41:28+00:00 2026-06-04T11:41:28+00:00

I have an Internet Explorer automation script in c#, it works ok but I

  • 0

I have an Internet Explorer automation script in c#, it works ok but I want to access a captcha image the captcha link returns a refreshed image every time it is visited, and since the browser has already visited it once visiting it again would mess things up, so I tried to find the image in the browsers cache on the disk with the following code

tempDir = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache).ToString();
System.Console.WriteLine(tempDir);
supstra = element.innerHTML.ToString().Substring(element.innerHTML.ToString().IndexOf("/sorry/image?id="), element.innerHTML.ToString().Length - element.innerHTML.ToString().IndexOf("/sorry/image?id="));
Console.WriteLine("http://www.goolge.com/sorry/image?id=" + element.innerHTML.ToString().Substring(element.innerHTML.ToString().IndexOf("/sorry/image?id="), supstra.IndexOf("&hl=")));
captchas = client.Decode(tempDir + "\\" + element.innerHTML.ToString().Substring(element.innerHTML.ToString().IndexOf("/sorry/image?id=") + 7, supstra.IndexOf("&hl=")).Replace("amp;", "") + "=en", 0);

The image however in the cache directory is not an image but a command or something with the name image?id=....

and all it does is revisit and get new image. What do I have to do it seems is to somehow access the image the browser is showing, which might be only in the memory, how can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:41:29+00:00Added an answer on June 4, 2026 at 11:41 am

    See this thread here on Accessing IE cache in C#.

    Specifically, from the question:

    Since the Internet Explorer is already displaying the webpage, the images in the webpage must already be stored somewhere in local cache

    And the answer (emphasis mine):

    You want to use GetUrlCacheEntryInfo().

    Use the lpszLocalFileName of the INTERNET_CACHE_ENTRY_INFO structure
    upon return from the function.

    Furthermore, one of your premises is flawed. Sometimes IE only has an
    in-memory representation of the image and the item on disk has been
    deleted
    . This is the case if, for example, the no-cache directive has
    been set. Or the user has cleared their cache but not navigated from
    the page. Or the scavenger has deleted it but the user hasn’t
    navigated. There are probably 5 to 7 other scenarios as well.

    In the past when I’ve had to do something similar, I force the web browser (IE in this case) to use something like Fiddler2 as a proxy. In Fiddler2, I can then intercept the image requests for a particular URL and use C# to save them to disk in a known location. The automation program can then grab them from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an asp.net site which works fine in internet explorer but for
I want C# code to use Socks 5 proxies in Internet Explorer. I have
I have an Internet Explorer BHO that can execute a script on the current
How do I access the classic Internet Explorer COM automation object for a running
I have a strange problem in Internet Explorer with JavaScript. In every browser I
I have an issue with list-style-image property in CSS with Internet Explorer 8 If
am trying to use automation in from Microsoft Access 2003 to control Internet Explorer
Ok I have a strange issue again with Internet Explorer but this only happens
I have noticed that Internet Explorer, which is used by the Web Browser component,
I have a problem with internet explorer 6 and 7, please look this example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.