问题描述
嗨所有
i我实现了一个获取firefox浏览历史记录的窗口应用程序。
i知道任务完成后打开或访问placess .sqlite在c#.net
但是我有问题要访问或打开places.sqlite到c#我使用下面的代码:
使用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
sql_con = new SQLiteConnection(Data Source =+ dbPath +
; Version = 3; New = False; Compress = True;);
//打开连接
sql_con.Open();
sql_cmd = sql_con.CreateCommand();
//选择查询
字符串CommandText =select * from+ table;
但是当打开连接时我收到错误:文件打开时不是数据库文件
文件已加密或不是数据库
甚至places.sqlite数据库在sqlite manger中完全打开,我可以在那里写查询如果有人有任何解决方案,请提供完美的解决方案
thanx&respect
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 to access or open places.sqlite through c# 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"
sql_con = new SQLiteConnection("Data Source=" + dbPath +
";Version=3;New=False;Compress=True;");
// Open the Connection
sql_con.Open();
sql_cmd = sql_con.CreateCommand();
// Select Query
string CommandText = "select * from " + table;
but when open the connection i got error:File opened that is not a database file
file is encrypted or is not a database
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
thanx & regards
Sanjay
推荐答案
Do you have the file already open in SQLite manager? Maybe it's locking the file before C# can open it
这篇关于通过c#获取firefox历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!