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

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -