Home > Net >  Vb.net how to get the bus has reported a device description
Vb.net how to get the bus has reported a device description

Time:01-24


Bosses, please help to see how can you get bus has reported the value of the equipment described in figure 2.4 G Mouse,
At this stage is the description of the code can only access the USB input devices, give advice or comments please! Thank you very much!
Private Sub Button1_Click (sender As Object, As EventArgs e) Handles for. Click
RichTextBox1. The Clear ()
Label2. Text=""
Dim test As New ManagementObjectSearcher
Test=New ManagementObjectSearcher ("/root/cimv2 ", "Select * from Win32_USBHub")

Dim momo As ManagementObjectCollection
Momo=test. Get the
For Each tt In momo
'the thread.sleep (100)

Try
If (Not String. IsNullOrEmpty (tt. Item (" Description "))) Then
RichTextBox1. AppendText (tt. Item (" Description "))
RichTextBox1. AppendText (" "& amp; VbNewLine)
End the If
Catch
RichTextBox1. AppendText (" "& amp; VbNewLine)
End the Try

RichTextBox1. ScrollToCaret ()
Next
The Console. ReadLine ()
End Sub

  • Related