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

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

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