Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is the code to get the browser files in the datagridview but i can't delete the browser history from database.
string opera = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Opera Software\opera stable\History";
SQLiteConnection con = new SQLiteConnection("DataSource=" + opera + "; version=3; new =false;compress=true;"

SQLiteDataAdapter sd = new SQLiteDataAdapter("select * from URLS", con);
DataSet ds = new DataSet();
sd.Fill(ds);

dataGridView1.DataSource = ds.Tables[0];
con.Close();
Posted
Updated 28-Dec-14 22:10pm
v6

1 solution

Do you try like this way?
C#
string _tempInetFile = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);
string _cookies = Environment.GetFolderPath(Environment.SpecialFolder.Cookies);
string _history = Environment.GetFolderPath(Environment.SpecialFolder.History);

List<string> folderPathList = new List<string> { _tempInetFile, _cookies, _history };

foreach(string dirpath in folderPathList)
try
{
Directory.Delete(dirpath, true);
}
catch{}

Also have some reference from these:
The Tiny Wrapper Class for URL History Interface in C#[^]
HOw to Clear Cache,Cookies and History of All Browser in C#.net [^]
 
Share this answer
 

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