title: Delete the browsing history of all browsers using C# code?
body: <p>Off recently i have got some interest in Windows application and im currently doing some programming based on windows application.</p>
  
  <p>Now im thinking to create a Windows(desktop) application using which i can delete the history of all the major browsers(ie chrome,firefox,safari,opera,ie). Among which im emphasizing on chrome and firefox. I have achieved the process of deleting the browser history of IE due to its inbuilt functionality in windows os using the follwing code</p>
  
  <pre><code>var p = new Process();
  p.StartInfo.CreateNoWindow = true;
  p.StartInfo.UseShellExecute = false;
  p.StartInfo.RedirectStandardError = true;
  p.StartInfo.RedirectStandardOutput = true;
  p.StartInfo.FileName = "rundll32.exe";
  p.StartInfo.Arguments = "InetCpl.cpl,ClearMyTracksByProcess 1";
  p.Start();
  p.WaitForExit();
  </code></pre>
  
  <p>And it works fine. Now coming over to other browsers.</p>
  
  <p>After much of research i have found various things.</p>
  
  <ol>
  <li>Chrome saves the data inside the SqlLite database. So by accessing the database the details can be deleted. I have worked on it based on idea from this link</li>
  </ol>
  
  <p><a href="https://stackoverflow.com/questions/8608200/programmatically-acess-google-chrome-history">Programmatically acess Google chrome history</a></p>
  
  <p>Also i learned that the various places where the details of the browsers are stored are:</p>
  
  <p>For Chrome: C:\Users\\AppData\Local\Google\Chrome\User Data</p>
  
  <p>For FireFox : C:\Users\\AppData\Local\Mozilla\Firefox\Profiles and C:\Users\\AppData\Roaming\Mozilla\Firefox\Profiles</p>
  
  <p>For Opera: C:\Users\\AppData\Local\Opera\Opera and C:\Users\\AppData\Roaming\Opera\Opera</p>
  
  <p>For Safari: C:\Users\\AppData\Local\Apple Computer\Safari and 
  C:\Users\\AppData\Roaming\Apple Computer\Safari.</p>
  
  <p>Now i have done a simple code using which i am able to delete all the history of all the browsers by just deleting the contents of the Specific folders that are described above.</p>
  
  <p>And while thinking globally im stuck with quiet few problems.</p>
  
  <ol>
  <li><p>In all the PC's the folder location are not in the same place. Ex: In another PC the Appdata folder was missing. So i was unable to make my application work on other system.</p></li>
  <li><p>If a PC is logged in by the admin then also locating the Appdata folder is difficult.</p></li>
  <li><p>If a user uses Portable Browser such as Opera or Safari where does the history get saved?</p></li>
  </ol>
  
  <p>So over come these problems i was thinking about a different way. But im not sure what should i follow.?</p>
  
  <p>I discovered that CC Cleaner deletes all the browsing history irrespective of the locations they are saved in. How does CC Cleaner do that? Is it possible to find the location of stored history using the System registry?</p>
  
  <p>Or is there any better way to clear all the browsing history?</p>
  
  <p>To summarize i dont want to access the appdata folder to delete the browsing history. Is there any other alternative?</p>
  
  <p>Any sample codes/links would be helpful.</p>
  
  <p>Thanks.</p>