i want to read serial number of my motherboard using vb 6.0
i tried this code bt its showing result as invalid
vb Code:
  1. Public Function MBSerialNumber() As String
  2. 'RETRIEVES SERIAL NUMBER OF MOTHERBOARD
  3. 'IF THERE IS MORE THAN ONE MOTHERBOARD, THE SERIAL
  4. 'NUMBERS WILL BE DELIMITED BY COMMAS
  5.  
  6. 'YOU MUST HAVE WMI INSTALLED AND A REFERENCE TO
  7. 'Microsoft WMI Scripting Library IS REQUIRED
  8.  
  9. Dim objs As Object
  10. Dim obj As Object
  11. Dim WMI As Object
  12. Dim sAns As String
  13.  
  14. Set WMI = GetObject("WinMgmts:")
  15. Set objs = WMI.InstancesOf("Win32_BaseBoard")
  16. For Each obj In objs
  17. sAns = sAns & obj.SerialNumber
  18. If sAns < objs.Count Then sAns = sAns & ","
  19. Next
  20. MBSerialNumber = sAns
  21. End Function