Skip to content
Ralf Beckers edited this page Nov 8, 2017 · 6 revisions

Welcome to the Media Devices

Media Devices is a API to interact with MTP (Media Transfer Protocol) devices like cell phones, tablets and cameras.

Download

NuGet Package

Getting Started

To get started, add the MediaDevices package to your project.

Call MediaDevice.GetDevices() to get a list of all currently available MTP devices.

Call device.Connect() to connect to the MTP device.

Example:

var devices = MediaDevice.GetDevices();
using (var device = devices.First(d => d.FriendlyName == "My Cell Phone"))  
{  
    device.Connect();  
    device.CreateDirectory(@"\Phone\Documents\Temp");   
    using(FileStream stream = File.OpenRead(@"C:/Temp/Test.txt"))   
    {   
        device.UploadFile(stream, @"\Phone\Documents\Temp\Test.txt");   
    }   
    device.Disconnect();   
}  

See the MediaDevices.chm for more information.

Clone this wiki locally