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