there is a way to retrieve cpu serial number?
any api for this?
daniel
Printable View
there is a way to retrieve cpu serial number?
any api for this?
daniel
Here's code to get the HARD DRIVE serial number...
BAS Module:
Code:Private Declare Function GetVolumeInformation Lib "Kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Routine:
Code:Public Function GetHardDriveSerialNumber() As Long
Dim strVolumeBuffer As String
Dim strSysName As String
Dim lngSerialNumber As Long
Dim lngSysFlags As Long
Dim lngComponentLen As Long
Dim lngResult As Long
strVolumeBuffer$ = String$(256, 0)
strSysName$ = String$(256, 0)
lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, lngComponentLen, lngSysFlags, strSysName$, 255)
GetHardDriveSerialNumber = lngSerialNumber
End Function
the only problem with Volume serial number is that when the harddisk formated, the serial number will change.:confused:
Is there anything that remains constant even after a formatting and clean reload of OS