问题描述
这是获取safari浏览器历史记录的代码,但是收到错误无法打开数据库文件
string apple = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)+ @\ AppleleComputer\Preferences\com.apple.Safari / Cache.db;
SQLiteConnection con = new SQLiteConnection(DataSource =+ apple +; version = 3; new = false; compress = true);
SQLiteDataAdapter sd = new SQLiteDataAdapter(select * from Page URL, con);
DataSet ds = new DataSet();
sd.Fill(ds);
dataGridView1.DataSource = ds.Tables [0];
con.close();
this is the code to get the safari browser history, but am getting the error unable to open database file
string apple = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\AppleComputer\Preferences\com.apple.Safari/Cache.db";
SQLiteConnection con = new SQLiteConnection("DataSource=" + apple + " ; version=3; new =false;compress=true");
SQLiteDataAdapter sd = new SQLiteDataAdapter("select * from Page URL", con);
DataSet ds = new DataSet();
sd.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
con.close();
推荐答案
string apple = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Apple Computer\Safari\WebPageIcons.db";
SQLiteConnection con = new SQLiteConnection("DataSource=" + apple + " ; version=3; new =false;compress=true");
SQLiteDataAdapter sd = new SQLiteDataAdapter("select url from PageURL", con);
DataSet ds = new DataSet();
sd.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
con.close();
这篇关于如何使用c#.net获取Windows窗体中的apple safari浏览器历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!