Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Delete Temporary Internet Files using c#

Delete Temporary Internet Files using c#

Scheduled Pinned Locked Moved C#
csharphelpworkspace
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    realmontanakid
    wrote on last edited by
    #1

    Hi I try to delete my Temporary Internet Files using C# Code. I thought.. no problem, but the only file that was found is the desktop.ini... No other files in that Directory.. private void button1_Click(object sender, EventArgs e) { string dir= Environment.GetFolderPath(Environment.SpecialFolder.InternetCache); foreach (string fileName in Directory.GetFiles(dir)) { File.Delete(fileName); } }

    G T 2 Replies Last reply
    0
    • R realmontanakid

      Hi I try to delete my Temporary Internet Files using C# Code. I thought.. no problem, but the only file that was found is the desktop.ini... No other files in that Directory.. private void button1_Click(object sender, EventArgs e) { string dir= Environment.GetFolderPath(Environment.SpecialFolder.InternetCache); foreach (string fileName in Directory.GetFiles(dir)) { File.Delete(fileName); } }

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Under what user account are you running the code? Each user account have their own cache folder for Internet Explorer. --- b { font-weight: normal; }

      R 1 Reply Last reply
      0
      • G Guffa

        Under what user account are you running the code? Each user account have their own cache folder for Internet Explorer. --- b { font-weight: normal; }

        R Offline
        R Offline
        realmontanakid
        wrote on last edited by
        #3

        Hi It's an account where the User is in the administrator group.

        G U 2 Replies Last reply
        0
        • R realmontanakid

          Hi It's an account where the User is in the administrator group.

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Are you sure? Check the contents of the Environment.UserName property. --- b { font-weight: normal; }

          1 Reply Last reply
          0
          • R realmontanakid

            Hi I try to delete my Temporary Internet Files using C# Code. I thought.. no problem, but the only file that was found is the desktop.ini... No other files in that Directory.. private void button1_Click(object sender, EventArgs e) { string dir= Environment.GetFolderPath(Environment.SpecialFolder.InternetCache); foreach (string fileName in Directory.GetFiles(dir)) { File.Delete(fileName); } }

            T Offline
            T Offline
            tarasn
            wrote on last edited by
            #5

            I found few articles that solves your problem : http://www.codeproject.com/csharp/ponta.asp[^] Another one can be found here http://www.codeguru.com/cpp/i-n/ieprogram/article.php/c1245/[^] but you must port this solution to C# DevIntelligence.com - My blog for .Net Developers

            1 Reply Last reply
            0
            • R realmontanakid

              Hi It's an account where the User is in the administrator group.

              U Offline
              U Offline
              usernamed
              wrote on last edited by
              #6

              Have you looked under C:\WINDOWS\TEMP\Temporary Internet files?

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups