Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 HELP with HWID
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
simon66




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: 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.
simon66




PostPosted: 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...
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: