我想为谷歌浏览器中的所有用户操作和网站编制索引。我知道谷歌浏览器索引了 sqlLite 数据库中的所有数据。我如何以编程方式访问我自己的应用程序中的 chrome 网络历史记录
最佳答案
您需要从 SqLite downloads page 下载合适的程序集
一旦您添加了对 SQLite 程序集的引用,它与标准 ADO.net 非常相似
所有用户历史记录都存储在历史数据库中,位于下面连接字符串中的路径
SQLiteConnection conn = new SQLiteConnection
(@"Data Source=C:\Users\YourUserName\AppData\Local\Google\Chrome\User Data\Default\History");
conn.Open();
SQLiteCommand cmd = new SQLiteCommand();
cmd.Connection = conn;
// cmd.CommandText = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;";
// Use the above query to get all the table names
cmd.CommandText = "Select * From urls";
SQLiteDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Console.WriteLine(dr[1].ToString());
}
关于c# - 以编程方式访问谷歌浏览器历史记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8608200/