0

Hello fellow programmers.

I recently made a mistake while using the SQLite-NET package for Windows Phone 8.1. When opening a new SQLiteConnection, I would give as parameter to its constructor the string "data.db", without being actually aware of what was going on under the hood. Later on, I noticed that the file wouldn't be deleted, even if I uninstalled the application (since I would have in my app the same entries that I had before uninstalling it); I assume that I should be using the local folder for application data instead. However, here is the real question: what the hell is the folder where the data.db file was created? I tried to figure it out with the following piece of code:

var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///data.db"));
System.Diagnostics.Debug.WriteLine(file.Path);

and what I got as output of the WriteLine method was the path

C:\Data\SharedData\PhoneTools\AppxLayouts\f7529f24-ba24-4fdb-8353-cff9214180a0VS.Debug_ARM.Valbrand\data.db,

which only got me even more confused. I couldn't find any satisfactory info on this, and I would REALLY like to further my understanding of what happened here.

Thanks in advance!

4

2 回答 2

1

您正在查看的路径是您的应用程序的安装目录。您有一个 Silverlight 8.1 应用程序,因此路径与 Silverlight 8.0 应用程序略有不同,但此处此处的文章将帮助您大致了解。

该目录的推荐用法是在第一次运行时将您要备份的资源取出并移动到应用程序数据容器中,以便系统对其进行备份。

于 2014-06-06T15:43:18.290 回答
0

C:\Data\SharedData\PhoneTools\AppxLayouts\f7529f24-ba24-4fdb-8353-cff9214180a0VS.Debug_ARM.Valbrand\data.db

这是您的手机/模拟器上的路径。

这不是您可以在 PC 中找到的位置。

于 2014-06-05T09:21:18.630 回答