title: How can i detect my digital camera connected to my pc usb ? Also the camera name
body: <p>In the top of form1:</p>
  
  <pre><code>class USBDeviceInfo
          {
              public USBDeviceInfo(string deviceID, string pnpDeviceID, string description)
              {
                  this.DeviceID = deviceID;
                  this.PnpDeviceID = pnpDeviceID;
                  this.Description = description;
              }
              public string DeviceID { get; private set; }
              public string PnpDeviceID { get; private set; }
              public string Description { get; private set; }
          }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>List&lt;string&gt; cameras = new List&lt;string&gt;();
  </code></pre>
  
  <p>In constructor:</p>
  
  <pre><code>var usbDevices = GetUSBDevices();
                  foreach (var usbDevice in usbDevices)
                  {
                      cameras.Add(usbDevice.DeviceID);
                      cameras.Add(usbDevice.PnpDeviceID);
                      cameras.Add(usbDevice.Description);
                  }
  </code></pre>
  
  <p>The GetUSBDevices() method:</p>
  
  <pre><code>static List&lt;USBDeviceInfo&gt; GetUSBDevices()
          {
              List&lt;USBDeviceInfo&gt; devices = new List&lt;USBDeviceInfo&gt;();
  
              ManagementObjectCollection collection;
              using (var searcher = new ManagementObjectSearcher(@"Select * From Win32_USBHub"))
                  collection = searcher.Get();
  
              foreach (var device in collection)
              {
                  devices.Add(new USBDeviceInfo(
                  (string)device.GetPropertyValue("DeviceID"),
                  (string)device.GetPropertyValue("PNPDeviceID"),
                  (string)device.GetPropertyValue("Description")
                  ));
              }
  
              collection.Dispose();
              return devices;
          }
  </code></pre>
  
  <p>What i'm getting in the cameras List is 3 items:</p>
  
  <p>In index 0: USB\ROOT_HUB20\4&amp;5E0D3C3&amp;0</p>
  
  <p>In index 1: USB\ROOT_HUB20\4&amp;5E0D3C3&amp;0</p>
  
  <p>In indes 2: USB Root Hub</p>
  
  <p>But what i want to do is first to detect my digital camera connected to the usb.
  And then to get the camera name this letters and numbers like 4&amp;5E0D3C3&amp;0 not saying to me a lot.
  And last to be able to copy delete files from the camera sd card like a directory like i'm doing it for example on c:\</p>