我使用“Sqlite for Windows Runtime”和 sqlite-net(正如http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows所述store-apps.aspx ) 来开发 Windows 8 Metro-App,只需 . 如果我想在 Program-Directory 中打开一个数据库是没有问题的:
var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");
using (var db = new SQLite.SQLiteConnection(dbPath)) {
...
}
但是当我想使用这样的外部路径时:
var dbPath = "C:\\Users\\xxxxxx\\db.sqlite";
然后出现“无法打开数据库文件”错误。为什么?这里我使用的是 C#,通常我使用 C++,但是对于这个问题,我相信这并不重要;)