- 最後登錄
- 2023-4-24
- 在線時間
- 186 小時
- 註冊時間
- 2008-4-1
- 閱讀權限
- 20
- 精華
- 0
- UID
- 3887184
- 帖子
- 372
- 積分
- 21 點
- 潛水值
- 5911 米
| 以下是取硬體的序號,至於怎麼混合加密就看你自已了- '取得CPU序號
- Public Declare Sub GetSystemInfo Lib "kernel32" (ByRef lpSystemInfo As SYSTEM_INFO)
- Public Structure SYSTEM_INFO
- Dim dwOemID As Integer
- Dim wProcessorArchitecture As Integer
- Dim wReserved As Integer
- Dim dwPageSize As Integer
- Dim lpMinimumApplicationAddress As Integer
- Dim lpMaximumApplicationAddress As Integer
- Dim dwActiveProcessorMask As Integer
- Dim dwNumberOrfProcessors As Integer
- Dim dwProcessorType As Integer
- Dim dwAllocationGranularity As Short
- Dim wProcessLevel As Short
- Dim wProcessorRevision As Short
- End Structure
- Public Function GetCPUCode() As String
- Dim CPUInfo As SYSTEM_INFO
- GetSystemInfo(CPUInfo)
- Return CPUInfo.dwProcessorType
- End Function
- '取得硬碟序號
- Private Function GetHardDriveCode(ByVal DrvIdx As Byte) As String
- Dim WMI As Object = GetObject("winmgmts:")
- Dim strCls As String = "Win32_PhysicalMedia"
- Dim strKey As String = strCls & ".Tag=""\\\\.\\PHYSICALDRIVE" & DrvIdx & """"
- Return WMI.InstancesOf(strCls)(strKey).SerialNumber.ToString.Trim
- System.Runtime.InteropServices.Marshal.ReleaseComObject(WMI)
- End Function
- '取得主機板序號
- Private Function GetMotherBoardCode() As String
- Dim WMI As Object = GetObject("winmgmts:")
- Dim strCls As String = "Win32_BaseBoard"
- Dim strKey As String = strCls & ".Tag=""Base Board"""
- Return WMI.InstancesOf(strCls)(strKey).SerialNumber.ToString.Trim
- System.Runtime.InteropServices.Marshal.ReleaseComObject(WMI)
- End Function
複製代碼 ... |
|