Tag: sd card

无法从WP8上的SD卡上的SQLite DB中检索数据

我在控制台应用程序中使用System.Data.SQLite创建了一个SQLite数据库。 然后我把它移到了Windows Phone的SD卡上。 我按照这些说明为我的WP8应用添加了SQLite支持: https : //github.com/peterhuene/sqlite-net-wp8 我找到了DB文件并打开它,如下所示: ExternalStorageFile file = null; IEnumerable storageDevices = await ExternalStorage.GetExternalStorageDevicesAsync(); foreach (ExternalStorageDevice storageDevice in storageDevices) { try { file = await storageDevice.GetFileAsync(“northisland.nztopomap”); } catch { file = null; } if (file != null) break; } SQLiteConnection conn = new SQLiteConnection(“Data Source=” + file.Path + “;Version=3;Read Only=True;FailIfMissing=True;”); SQLiteCommand command […]

C# – File Manipulation Galaxy S3 SD卡

我目前正在尝试编写一个小程序来检查我的Galaxy S3上的SD卡上的音乐然后检查我的计算机上的音乐文件夹并将我手机上没有的任何内容复制到它上面,反之亦然。 目前我正在努力找出SD卡的路径。 当我在我的文件系统中“当计算机\ SCH-I535 \ Card \ Music”在尝试检查该路径中存在的文件时返回false时,将显示路径窗口。 我希望有人可以通过告诉我如何正确找到SD卡的路径来帮助我。 我目前正在尝试使用C#,因为我想为这个应用程序提供一个很好的WPF UI。 这是我试图用来获取当前文件的代码,它抛出了我放入的exception。 namespace FileSync { public class SyncTools { private readonly string path = @”Computer\SCH-I535\Card\Music\test.mp3″; public bool pbExist() { bool exist = System.IO.File.Exists(path); if(exist == false) { throw new Exception(“File not found.”); } return exist; } } }