我需要使用C#windows Form应用程序检索Firefox历史记录(url)。
我正在使用Firefox 17.0.1版本。
我已经尝试使用DDEClient
类和SQLLite
数据库。两者都不起作用。
当我使用DDEClient
类时,我可以从Firefox获取活动标签页,当我使用SQLLite数据库时,它无法正常运行VS2010。
我如何达到这个要求?
答案 0 :(得分:0)
private static Logger logger = LogManager.GetCurrentClassLogger();
private static string dbName = "places.sqlite";
private static int dbColumnUrl = 1;
private static int dbColumnVisitDate = 9;
String strConnection = @"Data Source=" + newPath + @";Version=3;";
using (SQLiteConnection connection = new SQLiteConnection(strConnection))
{
string query = "select * from moz_places;";
using (SQLiteCommand cmd = new SQLiteCommand(query, connection))
{
connection.Open();
using (SQLiteDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
logger.Info("time: " + dr.GetValue(dbColumnVisitDate));
logger.Info("URL: " + dr.GetValue(dbColumnUrl));
}
}
}
}