Click here to Skip to main content
15,889,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a software application. I want to make a lock for its security against pirate copy user. How can I get processor Id or mother board Id or HDD Id using VB6?



Thank you in advance.

I am Jaimin Patel from Gujarat.
If you have any solution please send it to [DELETED]

[edit]Email deleted, capitalization, syntax - OriginalGriff[/edit]
Posted
Updated 19-Nov-10 8:17am
v2
Comments
OriginalGriff 19-Nov-10 14:17pm    
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email (like this one) to let you know.
fjdiewornncalwe 19-Nov-10 14:26pm    
Griff has given you a correct answer for this, but your issue is bigger. You'd have to also have a way of keeping h*ckers from simply hacking your binaries if they want a "free" version.

Look at accessing WMI - it should provide you with the hardware IDs you want Egghead Cafe on WMI in VB6[^]
 
Share this answer
 
Choose what you like the most WinAPI or Scripting:
Option Explicit
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 GetVolumeSN(byval optional strDrive As String = "C:\") As String
    Dim lpRootPathName As String, lpVolumeNameBuffer As String
    Dim nVolumeNameSize As Long, lpVolumeSerialNumber As Long
    Dim lpMaximumComponentLength As Long, lpFileSystemFlags As Long
    Dim lpFileSystemNameBuffer As String, nFileSystemNameSize As Long
    Dim ReturnVal As Long
    ReturnVal = GetVolumeInformation(strDrive, _
                                    lpVolumeNameBuffer, _
                                    nVolumeNameSize, _
                                    lpVolumeSerialNumber, _
                                    lpMaximumComponentLength, _
                                    lpFileSystemFlags, _
                                    lpFileSystemNameBuffer, _
                                    nFileSystemNameSize)
    GetVolumeSN = Hex(lpVolumeSerialNumber)
End Funtion

VB
Public Function GetVolumeSN(strDrive As String) As String
    Dim fso As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    GetVolumeSN = fso.GetDrive(strDrive).SerialNumber
End Function


Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900