天天看點

VB6.0超級子產品函數.GetCpuIdEx擷取電腦CPUI序列号

Function GetCpuIdEx() As String
    Dim TemMacId As String, TemMacId2 As String
    TemMacId2 = GetMAC
    TemMacId = geshi(TemMacId2)
    Dim temko As String
    Dim retstr As String
    Dim lentem As Long
    temko = GetCpuId
    lentem = Len(temko)
     retstr = GetCpuId
        Dim retstr1 As String
    temko = TemMacId
    lentem = Len(temko)
    For i = 1 To lentem
       retstr1 = retstr1 & Asc(Mid(temko, i, 1)) + i + 1 - 1 + 1 - 1 + 1 + 1 + 1
    Next i
       If TemMacId2 = "" Then End
       GetCpuIdEx = retstr & "170" & retstr1
End Function
           

調用方法:

Dim cpu as String 

cpu=GetCpuIdEx()

此函數主要用于做VB軟體綁定之用,比如寫資料庫軟體、遊戲輔助等都會用到。不過一般情況下我們都會用超級子產品的另一個函數來擷取網卡序列号作為綁定的參數。

VB交流站www.zai996.com q1016058890

繼續閱讀