kon0524/WpdMtp

How to get a single DeviceID?

Opened this issue · 2 comments

LGinC commented

I know the VID and PID, How to get the DeviceID.

LGinC commented

How to monitor the WPD hot plug event.
I need to get the device info when the device hot pluging

I know the VID and PID, How to get the DeviceID.

I would do this via regex:

var vid = "04e8";
var pid = "6860";
var cmd = new WpdMtpLib.MtpCommand();
foreach (var item in cmd.GetDeviceIds()) {
    if (System.Text.RegularExpressions.Regex.Match(item,".*vid_" + vid + "&pid_" + pid + ".*").Success) Console.WriteLine(item);
}