Solved

VB.net Windows Forms app - get information unique to that computer

Posted on 2014-01-19
4
887 Views
Last Modified: 2014-01-19
Hi

I want to get certain information about a users PC by sending each user a Windows Forms app that gathers information which is unique to that PC.
I know so far that I can use My.Computer.Name
What other information can I get that is unique to only that PC and what code would I use
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 334 total points
ID: 39792006
I admire your spirit, never give up!

The most commonly used is the disk serial (not the partition serial!), there are many ways to retrieve the serial, some using third party dll's.

Here is one: http://dllstore.net/Products/MachineId.aspx

Read this article http://www.codeproject.com/Articles/28678/Generating-Unique-Key-Finger-Print-for-a-Computer
0
 
LVL 27

Assisted Solution

by:MacroShadow
MacroShadow earned 334 total points
ID: 39792027
    Imports System
    Imports System.Management

    Public Class clsComputerInfo

        Friend Function GetProcessorId() As String
            Dim strProcessorId As String = String.Empty
            Dim query As New SelectQuery("Win32_processor")
            Dim search As New ManagementObjectSearcher(query)
            Dim info As ManagementObject

            For Each info In search.Get()
                strProcessorId = info("processorId").ToString()
            Next
            Return strProcessorId

        End Function

        Friend Function GetMACAddress() As String

            Dim mc As ManagementClass = New ManagementClass("Win32_NetworkAdapterConfiguration")
            Dim moc As ManagementObjectCollection = mc.GetInstances()
            Dim MACAddress As String = String.Empty
            For Each mo As ManagementObject In moc

                If (MACAddress.Equals(String.Empty)) Then
                    If CBool(mo("IPEnabled")) Then MACAddress = mo("MacAddress").ToString()

                    mo.Dispose()
                End If
                MACAddress = MACAddress.Replace(":", String.Empty)

            Next
            Return MACAddress
        End Function

        Friend Function GetVolumeSerial(Optional ByVal strDriveLetter As String = "C") As String

            Dim disk As ManagementObject = New ManagementObject(String.Format("win32_logicaldisk.deviceid=""{0}:""", strDriveLetter))
            disk.Get()
            Return disk("VolumeSerialNumber").ToString()
        End Function

        Friend Function GetMotherBoardID() As String

            Dim strMotherBoardID As String = String.Empty
            Dim query As New SelectQuery("Win32_BaseBoard")
            Dim search As New ManagementObjectSearcher(query)
            Dim info As ManagementObject
            For Each info In search.Get()

                strMotherBoardID = info("SerialNumber").ToString()

            Next
            Return strMotherBoardID

        End Function
       
    End Class

Open in new window


from: http://www.vbforums.com/showthread.php?508069-VB-NET-2005-A-Simple-Class-for-Getting-Hardware-Info

Thing you should know:

1. Not all motherboards have an imbedded serial.
2. There is a simple software that will change the MAC address.
0
 
LVL 69

Assisted Solution

by:Éric Moreau
Éric Moreau earned 166 total points
ID: 39792135
0
 

Author Closing Comment

by:murbro
ID: 39792180
Thanks very much for the help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now