Click to See Complete Forum and Search --> : Computer Serial Number???
Men.Shen
Jan 16th, 2000, 11:44 AM
How would I go about to retreiveing the Computer serial number on the click of a command button, and send it to a text box??
------------------
- M e n S h e n
Canabatech Programmer
Homepage: http://influx.virtualave.net
e-mail: essex@seedesigns.com
ICQ: 17527422
chrisjk
Jan 16th, 2000, 12:09 PM
This retrives the Hard disk serial number...
Put this code into a Module
Private Declare Function GetVolumeInformation Lib _
"kernel32.dll" Alias "GetVolumeInformationA" (ByVal _
lpRootPathName As String, ByVal lpVolumeNameBuffer As _
String, ByVal nVolumeNameSize As Integer, _
lpVolumeSerialNumber As Long, lpMaximumComponentLength _
As Long, lpFileSystemFlags As Long, ByVal _
lpFileSystemNameBuffer As String, ByVal _
nFileSystemNameSize As Long) As Long
Function GetSerialNumber(strDrive As String) As Long
Dim SerialNum As Long
Dim Res As Long
Dim Temp1 As String
Dim Temp2 As String
Temp1 = String$(255, Chr$(0))
Temp2 = String$(255, Chr$(0))
Res = GetVolumeInformation(strDrive, Temp1, _
Len(Temp1), SerialNum, 0, 0, Temp2, Len(Temp2))
GetSerialNumber = SerialNum
End Function
Add this code to the click event of a command button, with a textbox called Text1 on your form.
Text1.Text= GetSerialNumber("C:\")
Hope that helps :)
Regards,
------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)
[This message has been edited by chrisjk (edited 01-17-2000).]
Men.Shen
Jan 16th, 2000, 12:14 PM
Not to be rude, but I did say Computer Serial, not the drive serial, thank you anyways, but I am in need of the computer serial.
------------------
- M e n S h e n
Canabatech Programmer
Homepage: http://influx.virtualave.net
e-mail: essex@seedesigns.com
ICQ: 17527422
Clunietp
Jan 16th, 2000, 12:23 PM
Different manufactures may or may not burn the computer serial number into a ROM somewhere on the motherboard.....and if they do, you'll need to have proprietary information on how to retrieve it. What about white boxes?
You can also use the MAC address of the NIC card (if there is one) or use the P3 serial # (once again, if they have a P3, and the function is not disabled...)
Other than those possibilities, there is no unique serial number that every computer has.
Danial
Jan 12th, 2004, 09:08 PM
Originally posted by Men.Shen
[B]Not to be rude, but I did say Computer Serial, not the drive serial, thank you anyways, but I am in need of the computer serial.
What do you mean by Computer Serial? HD Serial, CPU Serial?
Your could look into WMI Scripting library, you can access a lot of system information using WMI.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.