// Clear the ListBox.
Devices.Items.Clear();
// Create a DeviceManager instance
DeviceManager deviceManager = new DeviceManager();
// Loop through the list of devices and add the name to the listbox
for (int i = 1; i <= deviceManager.DeviceInfos.Count; i++)
{
var deviceName = deviceManager.DeviceInfos[i].Properties["Name"].get_Value().ToString();
Devices.Items.Add(deviceName);
}
ติด var ไม่รู้จะใส่ตัวหน้าอะไร
var deviceName = deviceManager.DeviceInfos[i].Properties["Name"].get_Value().ToString();