VB.NET2005 取得磁盘、主板、CPU 的 ID
Imports System.Management
Public Class GetIDClass
Public Sub New()
End Sub
Public Function GetID() As String
Dim ID As String
ID = GetHardDriveID()
If ID <> "" Then
Return ID
Else
ID = GetMainBoardID()
If ID <> "" Then
Return ID
Else
ID = GetCUPID()
If ID <> "" Then
Return ID
Else
Return "Err"
End If
End If
End If
End Function
Private Function GetHardDriveID() As String
Try
GetHardDriveID = ""