C# - File Manipulation Galaxy S3 SD Card

拜拜、爱过 提交于 2019-12-08 05:00:57

问题


I am currently trying to write a small program to check my SD card on my Galaxy S3 for music then check my music folder on my computer and copy anything I don't have on my phone to it and vice versa. Currently I am struggling to figure out the path to the SD card. The path windows is displaying when I go there in my file system "Computer\SCH-I535\Card\Music" returns false when attempting to check that files exist at that path. I was hoping some one might be able to help me by telling me how to properly find the path to the SD Card. I am currently attempting to use C# because I wanted a nice WPF UI for this application. Here is the code I am attempting to use to get the files currently and it is throwing the exception I put in.

 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;
         }
     }
 }

回答1:


I found a solution via "Microsoft Shell Controls and Automation COM API" (shell32.dll)

see here: http://dev.flauschig.ch/wordpress/?p=212



来源:https://stackoverflow.com/questions/16762215/c-sharp-file-manipulation-galaxy-s3-sd-card

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!