【问题标题】:Programmatically acess (c#) internet explorer chrome history in windows 10 64 bit在 Windows 10 64 位中以编程方式访问(c#)Internet Explorer chrome 历史记录
【发布时间】:2017-03-18 07:13:12
【问题描述】:

我想索引 Internet Explorer 中的所有用户操作和网站。我了解 Internet Explorer 索引 sqlLite 数据库中的所有数据。如何在我自己的应用程序中以编程方式访问 Internet Explorer 网络历史记录

SQLiteConnection conn = new SQLiteConnection(@"Data Source= C:\Users\47\AppData\Local\Microsoft\Internet Explorer\IECompatData\iecompatdata ");
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 url,title,visit_count,datetime(last_visit_time / 1000000 + (strftime('%s', '1601-01-01')), 'unixepoch'),typed_count from urls order by last_visit_time desc";
//"Select * From urls order by last_visit_time desc";
DataSet ds = new DataSet();

SQLiteDataReader dr = cmd.ExecuteReader();

while (dr.Read())
{
    dataGridView1.Rows.Add(dr[0].ToString(),dr[1].ToString(), dr[2].ToString(), dr[3].ToString(), dr[4].ToString());
}

我尝试了上面的代码,但是得到了一个像

这样的异常

System.Data.SQLiteException{"SQL 逻辑错误或缺少数据库\r\nno 这样的表:urls"}

我刚刚验证了其他一些位置,例如 C:\Users\47\AppData\Local\Microsoft\Internet Explorer\Recovery 那些也不起作用 我认为这是因为 IE 历史记录位置或表名...

【问题讨论】:

  • 在此路径下,我只看到一个 XML,其中包括为旧 IE 版本模拟的站点。为什么你认为 IE 使用 SQLite?
  • 我真的不知道我使用 SQLite 从 IE 获取了 URL 历史记录。我没有找到任何其他解决方案
  • 查看历史记录:C:\Users\47\AppData\Local\Microsoft\Windows\History
  • 我试过 C:\Users\47\AppData\Local\Microsoft\Windows\History 这个位置并得到异常 {"unable to open database file"}
  • 再说一遍,IE 不使用 SQLite

标签: c# winforms visual-studio internet-explorer


【解决方案1】:

您的 SQLite 连接错误。您指向的数据源不是 SQLite 文件 - 它是 XML 文件。 SQLite 扩展名是sqlitedatabse.db

您应该执行此步骤:
创建一个 SQLite 数据库,然后将数据从 XML 文件导出到您的 SQLite 数据库,如以下链接:how to export data from XML to sqlite

【讨论】:

  • 取而代之的是IE的任何数据库,我可以直接获取详细信息
  • 你知道你可以在没有任何数据库的情况下直接读取 XML 文件,这个解决方案肯定是可用的
猜你喜欢
  • 2012-01-26
  • 1970-01-01
  • 2010-09-08
  • 2015-08-31
  • 2011-08-25
  • 1970-01-01
  • 2016-01-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多