-
Notifications
You must be signed in to change notification settings - Fork 0
/
cHardware.vb
34 lines (24 loc) · 1000 Bytes
/
cHardware.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Option Strict On
Imports System.Management
Public Class cHardware
'Author: khurram saddique (skhurams)
'Ref: http://www.codeproject.com/KB/vb/hardware_Security_2.aspx
Public Shared Function GetProcessorId() As String
Dim strProcessorId As String = String.Empty
Dim query As New SelectQuery("Win32_processor")
Dim search As New ManagementObjectSearcher(query)
For Each info As ManagementObject In search.Get()
strProcessorId = info("processorId").ToString()
Next
Return strProcessorId
End Function
Public Shared Function GetMotherBoardID() As String
Dim strMotherBoardID As String = String.Empty
Dim query As New SelectQuery("Win32_BaseBoard")
Dim search As New ManagementObjectSearcher(query)
For Each info As ManagementObject In search.Get()
strMotherBoardID = info("SerialNumber").ToString()
Next
Return strMotherBoardID
End Function
End Class