HELP with HWID
Author |
Message |
simon66
|
Posted: Mon Jan 05, 2009 4:00 pm Post subject: HELP with HWID |
|
|
hey I would like to know how to get your computer Hard Ware ID (HWID) and vb 6. This is the code I have
Quote: 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
Private Sub Form_Load()
Dim Serial As Long, VName As String, FSName As String
'Create buffers
VName = String$(255, Chr$(0))
FSName = String$(255, Chr$(0))
'Get the volume information
GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
'Strip the extra chr$(0)'s
VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
Text1.Text = "Your computer HWID is:" + Trim(Str$(Serial)) + " "
End Sub
and i have a text box
so what is wrong here? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
DemonWasp
|
Posted: Mon Jan 05, 2009 4:47 pm Post subject: RE:HELP with HWID |
|
|
Please use [ syntax = " language " ] and [ / syntax ] tags to make your code easier to read.
Also, a better description of the problem you're encountering goes a long way. Does the program not compile or run? Does the program crash? Does the output not match what you expected, and if so, what were you expecting, and what did you get?
Make it easy for us to help you and we'll be more likely to. |
|
|
|
|
![](images/spacer.gif) |
simon66
|
Posted: Mon Jan 05, 2009 4:59 pm Post subject: Re: HELP with HWID |
|
|
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
Private Sub Form_Load()
Dim Serial As Long, VName As String, FSName As String
'Create buffers
VName = String$(255, Chr$(0))
FSName = String$(255, Chr$(0))
'Get the volume information
GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
'Strip the extra chr$(0)'s
VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
Text1.Text = "Your computer HWID is:" + Trim(Str$(Serial)) + " "
End Sub |
what I got here is my C drive but what I wanted is my PC HWID so that I could generate a program that runs only in that computer HWID to reduce he user to reproduce and sell it... |
|
|
|
|
![](images/spacer.gif) |
|
|