|
-
Jan 16th, 2000, 12:44 PM
#1
Thread Starter
New Member
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: [email protected]
ICQ: 17527422
-
Jan 16th, 2000, 01:09 PM
#2
PowerPoster
This retrives the Hard disk serial number...
Put this code into a Module
Code:
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.
Code:
Text1.Text= GetSerialNumber("C:\")
Hope that helps 
Regards,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it 
[This message has been edited by chrisjk (edited 01-17-2000).]
-
Jan 16th, 2000, 01:14 PM
#3
Thread Starter
New Member
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: [email protected]
ICQ: 17527422
-
Jan 16th, 2000, 01:23 PM
#4
Guru
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.
-
Jan 12th, 2004, 10:08 PM
#5
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.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|