2

When you plug in (via USB) a mobile phone into a Windows 10 laptop, it comes up as a device. How do I access the files on this in C#. For example an iPhone when plugged in shows like this:

Windows 10 devices with iPhone plugged in

I would like to get all of the data off of that. I have already tried using the paths 'This PC\Apple iPhone\Internal Storage' and '\This PC\Apple iPhone\Internal Storage', both crashed the programming saying that they could not find the files.

I am then going to read and copy files off this in C#

Note: I would like this to work for all types of phone, not just an iPhone (Android and iPhone would be fine though).

  • 2
    You're looking for the MTP protocol. Perhaps [this answer](https://stackoverflow.com/questions/18512737/how-to-manage-files-on-an-mtp-portable-device#60478271) helps – MoltenCore Jan 08 '22 at 15:47
  • 1
    Thanks, this helps a lot. Sorry for the late response, I was customising it to make sure it would work for my case as this is not a simple a copy-and-paste test. Thanks again :). Feel free to put it as an answer, I will upvote and accept. – James Ashwood Jan 08 '22 at 16:32

1 Answers1

1

The real problem you're trying to resolve is to access a device through the MTP protocol. The question has been asked before on SO.

You can try to use Windows Portable Device API directly (I'm assuming this is windows due to the screenshot).

Another option would be using the MediaDevices NuGet package like the linked answer does.

MoltenCore
  • 21
  • 1
  • 3