从places.sqlite数据库中获取firefox url历史数据 [英] fetching data from places.sqlite database for firefox url history
问题描述
嗨所有
i我实现了一个获取firefox浏览历史记录的窗口应用程序。
i知道任务完成后打开或访问placess .sqlite在c#.net
但我有问题我使用下面的代码:
使用system.data.sqlite;
SQLiteConnection sql_con;
SQLiteCommand sql_cmd;
SQLiteDataAdapter DB;
DataTable DT = new DataTable();
string dbpath =C:\Users\administrator\AppData \Roaming\Mozilla\Firefox \Profiles \ 2f92gtpv.default\places.sqlite
dbPath = dbPath.Replace(places.sqlite,places);
sql_con = new SQLiteConnection(Data Source =+ dbPath +
; Version = 3; New = False; Compress = True;);
//打开连接
sql_con.Open(); //这里连接成功打开并且状态显示打开
sql_cmd = sql_con .CreateCommand();
//选择查询
string CommandText =select * from moz_places;
//填充数据表
DB =新的SQLiteDataAdapter(CommandText,sql_con);
DB.Fill(DT) ;
但是当从表中填充数据时出现错误:SQLite错误
没有这样的表:moz_places
甚至places.sqlite数据库在sqlite manger中是完全开放的,我可以在那里写查询,它提供的结果很好
如果有人有任何解决方案,请提供完美的解决方案
请帮助我,我在这个主题上苦苦挣扎
thanx&问候
Sanjay
hi all
i am implementing a window application for getting firefox browsing history.
i know that task complete by open or access "placess.sqlite" in c#.net
but i have problem i use the code below :
using system.data.sqlite;
SQLiteConnection sql_con;
SQLiteCommand sql_cmd;
SQLiteDataAdapter DB;
DataTable DT = new DataTable();
string dbpath="C:\Users\administrator\AppData\Roaming\Mozilla\Firefox\Profiles\2f92gtpv.default\places.sqlite"
dbPath = dbPath.Replace("places.sqlite", "places");
sql_con = new SQLiteConnection("Data Source=" + dbPath +
";Version=3;New=False;Compress=True;");
// Open the Connection
sql_con.Open();//here connection open successfuly and its state show open
sql_cmd = sql_con.CreateCommand();
// Select Query
string CommandText = "select * from moz_places";
// Populate Data Table
DB = new SQLiteDataAdapter(CommandText, sql_con);
DB.Fill(DT);
but when populate data from table i got error:SQLite error
no such table: moz_places
even places.sqlite database is perfectly open in sqlite manger and i can write query there and its provide result in well maner
if anyone have any solution please provide perfect solution
Please Help me i am struggling lot on that topic
thanx & regards
Sanjay
推荐答案
您的目标是错误的文件。您要使用的文件是places.sqlite而不是地方,所以不要替换名称。
You are targeting a wrong file. The file that you want to use is places.sqlite not places so don't replace the name .
这篇关于从places.sqlite数据库中获取firefox url历史数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!