Rajeshkumar Kandhasamy
Rajeshkumar Kandhasamy

Reputation: 6461

How do i Clear browsing history from Windows desktop application..?

Is there any way to clear Browser History using C# or VB.net desktop application.

Browser Name, Starting time and Usage Time and all i got it.But i can't able to delete that particular browser history.Is it possible..? or any Ideas and Suggestions.

This is My code:

 Process[] processlist = Process.GetProcesses();
                RegistryKey browserKeys;
                browserKeys = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\WOW6432Node\Clients\StartMenuInternet");
                if (browserKeys == null)
                    browserKeys = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Clients\StartMenuInternet");
                string[] browserNames = browserKeys.GetSubKeyNames();
                foreach (Process theprocess in processlist)
                {
                    foreach (string Bkeys in browserNames)
                    {
                        string BrowseKeys = Bkeys.ToLower().Replace(".exe", "").ToString();
                        if (theprocess.ProcessName.ToLower().ToString() == BrowseKeys.ToLower().ToString())
                        {
                            table1.Rows.Add(theprocess.ProcessName.ToUpper().ToString(), theprocess.StartTime.ToString(), theprocess.UserProcessorTime.ToString(), theprocess.TotalProcessorTime.ToString(), DateTime.Now);
                        }
                    }
                }

Thanks in Advance,

The R1....

Upvotes: 1

Views: 3198

Answers (2)

Carlito
Carlito

Reputation: 805

Each browser saves its browser history in a different way and at a different location. I have tried to accomplish something similar a few months ago. I have used this link which discribes the process for both internet explorer and firefox. It might be outdated but I think it will get you started.

Upvotes: 1

Konrad Morawski
Konrad Morawski

Reputation: 8394

Yes of course it is possible (e.g. CCleaner can do that for you), but browsers store their history in their own files, not in Windows registry.

For example Firefox uses an SQLite database for storing history (as well as bookmarks etc.). So does Chrome I think (or at least it used do).

You can use the http://sourceforge.net/projects/sqlite-dotnet2/ library for managing SQLite databases.

Upvotes: 1

Related Questions