Am attempting to query the serial number and the model of the monitor.
I managed to use the WMI code creator to generate the below code:
Try
Dim MInfo As New ManagementObjectSearcher("root\WMI", "SELECT * FROM WmiMonitorID")
For Each Monitor In MInfo.Get()
If Monitor("SerialNumberID") Is Nothing Then
MsgBox("NA")
Else
Dim arrSerialNumberID As UInt16()
arrSerialNumberID = Monitor("SerialNumberID")
For Each arrValue As UInt16 In arrSerialNumberID
Console.WriteLine("Serial: " & arrValue)
Next
End If
If Monitor("UserFriendlyName") Is Nothing Then
MsgBox("NA")
Else
Dim arrSerialNumberID As UInt16()
arrSerialNumberID = Monitor("UserFriendlyName")
For Each arrValue As UInt16 In arrSerialNumberID
Console.WriteLine("Model: " & arrValue)
Next
End If
Next
Catch err As ManagementException
MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
End Try
The output is as per below:
SerialNumberID: 67,78,75,52,49,49,49,49,55,57,0,0,0,0,0,0
UserFriendlyName: 104,112,32,76,49,53,51,48,0,0,0,0,0
I am trying to convert the output to ASCII.