Results 1 to 5 of 5

Thread: Computer Serial Number???

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    10

    Post

    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


  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    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
    chris.kilhams@btinternet.com
    If it ain't broke - don't fix it


    [This message has been edited by chrisjk (edited 01-17-2000).]

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    10

    Post

    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


  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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.


  5. #5
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    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
  •  



Click Here to Expand Forum to Full Width