VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
1,958 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi ,I want to find the serial number of CH341A device. How can I do that?
Please help
Thanks
Hi @kaveh rahimi ,
Add reference to 'System.Management', then try the code like:
Dim theSearcher As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive WHERE InterfaceType='USB'")
For Each currentObject As ManagementObject In theSearcher.Get()
Dim theSerialNumberObjectQuery As ManagementObject = New ManagementObject()
theSerialNumberObjectQuery.Path = "Win32_PhysicalMedia.Tag='" & currentObject("DeviceID") & "'"
MessageBox.Show(theSerialNumberObjectQuery("SerialNumber").ToString())
Next
Hope it could be helpful.
Best Regards,
Xingyu Zhao
*
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi @kaveh rahimi ,
Not sure you can get 'reported device ids hash', do you consider getting the 'PNPDeviceID' of USB?
Here's the code you can refer to.