c# - Exception to ComboBox -
i looking way remove physical disk 0 when aquisition of list of device on computer.
the command executed follows:
managementobjectsearcher mosdisks = new managementobjectsearcher("select * win32_diskdrive"); foreach (managementobject modisk in mosdisks.get()) { drivelist.items.add(modisk["model"].tostring()); }
thank help.
managementobjectsearcher mosdisks = new managementobjectsearcher("select * win32_diskdrive"); foreach (managementobject modisk in mosdisks.get()) { if(!modisk["deviceid"].tostring().contains("physicaldrive0")) { drivelist.items.add(modisk["model"].tostring()); } }
or more simply, change wql this:
select * win32_diskdrive not name '%physicaldrive0'
Comments
Post a Comment