Results 1 to 2 of 2

Thread: [RESOLVED] HWID ( 2 same codes 1 works 1 don't ) Error to do with Define

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Resolved [RESOLVED] HWID ( 2 same codes 1 works 1 don't ) Error to do with Define

    Hi Guys I downloaded HWID Which lets me create lock to pc for my app

    Original source works but when i try and add that to my app it dosent m i Missing something ?

    This is the code

    Code:
    Imports System.Net
    Imports System.Management
    Public Class Form1
    
    
        '''''''''''''''''''''''''''''''''''''''
        '''''''''''''''''''''''''''''''''''''''
        '''''''Gets the computer's HWID''''''''
        '''''''''''''''''''''''''''''''''''''''
        '''''''''''''''''''''''''''''''''''''''
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            Dim cpuInfo As String = String.Empty
            Dim mc As New ManagementClass("win32_processor")
            Dim moc As ManagementObjectCollection = mc.GetInstances()
    
            For Each mo As ManagementObject In moc
                If cpuInfo = "" Then
                    cpuInfo = mo.Properties("processorID").Value.ToString()
                    Exit For
                End If
            Next
    
            Dim HWID As String
    
            HWID = cpuInfo
    
    
            '''''''''''''''''''''''''''''''''''''''
            '''''''''''''''''''''''''''''''''''''''
            '''''''Checks if it matches your'''''''
            '''''''''''''''Database''''''''''''''''
            '''''''''''''''''''''''''''''''''''''''
            '''''''''''''''''''''''''''''''''''''''
    
            Dim wc As New WebClient
            Dim strings As String
            strings = wc.DownloadString("http://****************vorfin12345/Database.txt") 'Link to your uploaded file. 
            '(I advise using www.site.com to upload it.)
            wc.Dispose() 'Deletes the file it check HWID from. 
    
            If strings.Contains(HWID) Then  'If it does, show the program.
                MessageBox.Show("HWID Matches!", "Open!", MessageBoxButtons.OK, MessageBoxIcon.Information)
                'Now program as normal. 
            Else
                MessageBox.Show("Error, HWID Does Not Match!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Me.Close() 'If not, close the program and give a message.
            End If
        End Sub

    when I put above code in my app I get this 3 errors

    Error 1 Type 'ManagementClass' is not defined
    Error 2 Type 'ManagementObjectCollection' is not defined.
    Error 3 Type 'ManagementObject' is not defined


    So WHat m I doing wrong ?

    I coppyed original source as u see above to my form3 which will be loading screen

    but some reason I get errors above code is exacly the same

    Thanks for help guys

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Posts
    314

    Re: [RESOLVED] HWID ( 2 same codes 1 works 1 don't ) Error to do with Define

    Issue fixed I just had to

    add the management reference. (Project - Add Reference - .NET - System.Management )

    and wolla ;D fixed

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