2013-07-09 66 views
3

我正在寫一個Windows C#(winforms)應用程序,它將圖像從PC複製到Android設備Images文件夾。 Windows文件資源管理器給了我這個路徑: Computer \ SCH-I535 \ Phone \ Images但我無法通過路徑以編程方式訪問設備。從C#windows應用程序讀取/寫入三星android手機/平板電腦

我不確定如何從我的C#應用​​程序掛載或讀取Android設備。我確信這是簡單的,但我沒有運氣。

任何人都可以幫忙嗎?

+1

已經在這裏問:http://stackoverflow.com/questions/16762215/c-sharp-file-manipulation-galaxy-s3-sd-card是不是有一個銀河的USB驅動器模式? – spender

+0

我只在S3上看到媒體設備(MTP)和相機(PTP)選項。 – Mikos

回答

0

我做了快速搜索,發現

var drives = DriveInfo.GetDrives(); 

    var removableFatDrives = drives.Where(
    c=>c.DriveType == DriveType.Removable && 
    c.DriveFormat == "FAT" && 
    c.IsReady); 

    var andriods = from c in removableFatDrives 
      from d in c.RootDirectory.EnumerateDirectories() 
      where d.Name.Contains("android") 
      select c; 

這裏找到:Source

你移動到要放置文件的目錄,你可以用你的文件與文件傳輸:

String LocalPC_FileLocation = "C://mydoc//mylocation//imagefile"; 


    File.Move(LocalPC_FileLocation , locationofandroiddirectory); 
+2

這隻適用於Android存儲可以映射到驅動器盤符的情況,這不是OP描述的內容。 – Aximili

+0

我的情況「電腦\索尼Xperia tipo \內部存儲」和「電腦\索尼Xperia tipo \ SD卡」 - http://stackoverflow.com/questions/18297207/access-file-on-my-android-phone-from -c-尖銳 – Kiquenet

相關問題