Sqlite3.Open总是返回CannotOpen

时间:2015-04-10 21:05:12

标签: c# sqlite

我正在尝试使用C#和sqlite访问skype本地数据库,但我的尝试总是失败 这是连接代码: -

StorageFolder sf =  Windows.Storage.ApplicationData.Current.LocalFolder;
string k = Path.GetDirectoryName(sf.Path);
k = k.Substring(0, k.LastIndexOf('\\'));
k = k + '\\'+ "Microsoft.SkypeApp_kzf8qxf38zg5c" + '\\'+ "LocalState" + '\\' + "goldenwingsonline";
var path = Path.Combine(k, "main.db");
using (var db = new SQLite.SQLiteConnection(path))
{
    string change = string.Empty;
    try
    {

    }
    catch (Exception ex)
    {
    }
}

代码总是在sqlite类中返回CannotOpen,特别是在这行代码

var r = SQLite3.Open (databasePathAsBytes, out handle, (int) openFlags, IntPtr.Zero);

虽然路径正确,但是当我尝试在文件浏览器中打开它时 它 Error while opening main.db through file-explorer

请帮忙吗?

0 个答案:

没有答案