2014-10-04 147 views
0

我的Windows Phone 8.1应用程序中有一个SQLite数据库。我通过使用此代码复制它SQLite数据库存储在Windows Phone 8.1中的位置

public async void UpDatabase() 
{ 
     bool isDatabaseExisting = false; 

     try 
     { 
      StorageFile storageFile = await ApplicationData.Current.LocalFolder.GetFileAsync("ComplainSys.db"); 
      isDatabaseExisting = true; 
     } 
     catch 
     { 
      isDatabaseExisting = false; 
     } 

     if (!isDatabaseExisting) 
     { 
      StorageFile databaseFile = await Package.Current.InstalledLocation.GetFileAsync("ComplainSys.db"); 
      await databaseFile.CopyAsync(ApplicationData.Current.LocalFolder); 
     } 
    } 

我想访问它存储的位置。当我放置断点并检查该路径并尝试访问它时显示此错误。

enter image description here enter image description here

如何访问呢?

回答

0

ApplicationData.Current.LocalFolder是该文件夹。但我真的不知道您是如何使用断点访问文件夹的,您是否使用Windows资源管理器打开该文件夹?路径是电话存储的本地路径,而不是电脑的路径。

+0

是通过复制路径如图所示 – 2014-10-04 12:48:23

+0

@ user3814490您无法使用计算机的资源管理器来打开该文件夹。为了访问它,你需要使用WinRT API或尝试使用Isolated Storage Explore,但我不确定它是否适用于WinRT。 – 2014-10-04 12:50:40

+0

@ user3814490是的,独立存储资源管理器将与WinRT应用程序一起使用,您也可以查看独立存储间谍。 – Romasz 2014-10-04 16:24:11

0

我用其他的软件,我认为这是比独立存储更多的好,不需要加在你的项目中外部类或相同的......我用这个:http://isostorespy.codeplex.com/downloads/get/835310

只要解压缩文件夹,然后打开你的模拟器,当模拟器打开时,执行.exe并选择你的模拟器,然后你可以浏览本地,漫游和临时文件夹。最后,这个软件可以与windows phone 8+(8,8.1)一起使用。这太简单了!

PD:如果你有问题劝我,祝你好运!

相关问题