In "USB mass storage device" a "position" in the details if can be the difference in the position of the HUB, but looking for a long time but could not find how to read the attributes,
Search on the Internet for a long time, most of them are using WMI, but also does not have this property in the WMI,
Please have someone can guide,
CodePudding user response:
That is the way I used to query the NumberOfPorts are NULL NULLManagementObjectSearcher searcher=new ManagementObjectSearcher (textBox1. Text);
//ManagementObjectSearcher searcher=new ManagementObjectSearcher (" Select * From Win32_Processor ");
Foreach (ManagementObject dm in a searcher. The Get ())
{
ListBox1. Items. The Add (" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ");
ListBox1. Items. The Add (dm) [r]. "the Name" the ToString ());
Foreach (var property in dm. The Properties)
{
ListBox1. Items. The Add (num. ToString () + ", "+ property. The Name +" : "+ property. The Value).
Num++;
//the Console. WriteLine (property. The Name + ":" + property. The Value).
}
}
CodePudding user response:
WMI: Win32_DiskDrive
CodePudding user response: