Click here to Skip to main content
15,948,339 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C# Delete Temporary internet files and website files in IE 11

Update record not showing without deleting Temporary internet files and website files in IE 11 

i going to edit any record and update record that time update record in database but can't showing in my list of record page even ctr+ ff5 frefress page. 


What I have tried:

C#
public void CleareHistry()
      {
         // ClearFolder(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)));
          string path = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);
          //for deleting files
          DirectoryInfo di = new DirectoryInfo(path);
          foreach (FileInfo file in di.GetFiles())
          {
              try
              {
                  file.Delete();
              }
              catch
              {

              }

          }
          foreach (DirectoryInfo dir in di.GetDirectories())
          {
              try
              {
                  dir.Delete(true); //delete subdirectories and files
              }
              catch
              {

              }
          }
      }
Posted
Updated 21-Aug-19 19:19pm
v2

1 solution

All C# code is run on the server, not the client - and has no access whatsoever directly to the client file system.
So GetFolderPath will always return a server-based path, and - assuming the server even has IE installed, which is unlikely - your code will only ever affect server internet history, not client.

It may look like it works in development, because the Server and Client are the same physical computer - but in production they are potentially thousands of miles apart!
 
Share this answer
 
Comments
Member 11882351 22-Aug-19 1:41am    
so how can i delete code from client side . or what to change in my code.

Because when i edit any record from list of record and do some changes and then update the record and go back to list of record that time showing old record not updated even i redressing page in database is showing correct updated record. this problem happens only in IE browser only.
if i delete Temporary internet files and website files in IE 11 then after showing correct data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900