Is there a way to get an unique Identifier of a Computer?... like a vendor code of the processor or the harddisk...
thanks
Printable View
Is there a way to get an unique Identifier of a Computer?... like a vendor code of the processor or the harddisk...
thanks
This will get the hard disk serial number.
VB 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 Public Function GetSerialNumber() 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) GetSerialNumber = lngSerialNumber End Function
There is nothing on a PC that will remain completely unique throughout the life of a PC. Computer Names can get changed, hard drives can be swapped out, etc.
There should be a tag somewhere on the outside of the PC with the actual PC serial number, but this is not something you can obtain programmatically.
If you could get and ID or Serial number of the processor that would probably be more usefull. Most people don't buy a new processor very often, and usually when they do they just buy a whole new computer.
It doesn't seem to work consistently for network drives. Does somebody have code demonstrating the ability to consistently get the serial number of network drives as well as local drives in W97 to WordXP?Quote:
Originally posted by MartinLiss
This will get the hard disk serial number.
VB Code:
snipped for the sake of brevity...
Thanks!
ck