Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to get the Hard Disk or Mother Board Id through C#

How to get the Hard Disk or Mother Board Id through C#

Scheduled Pinned Locked Moved C#
csharphardwaretutorial
7 Posts 4 Posters 10 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moonangel_bio
    wrote on last edited by
    #1

    i need to secure an application using any hardware ID thanx Martyr

    S D 2 Replies Last reply
    0
    • M moonangel_bio

      i need to secure an application using any hardware ID thanx Martyr

      S Offline
      S Offline
      SimonS
      wrote on last edited by
      #2

      Hope this helps. using System.Management; ... ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID='C:'"); string volumeNumber= disk.Properties["VolumeSerialNumber"].Value.ToString(); Cheers, Simon > blog:: brokenkeyboards > my opinion of VS05 :: here > CV :: PDF > skype me! :: SimonMStewart

      D 1 Reply Last reply
      0
      • M moonangel_bio

        i need to secure an application using any hardware ID thanx Martyr

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Strt generating your own ID's 'cause getting them from the hardware is spotty at best. There is no standard that MUST be followed by all vendors for tagging their hardware. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        D 1 Reply Last reply
        0
        • S SimonS

          Hope this helps. using System.Management; ... ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID='C:'"); string volumeNumber= disk.Properties["VolumeSerialNumber"].Value.ToString(); Cheers, Simon > blog:: brokenkeyboards > my opinion of VS05 :: here > CV :: PDF > skype me! :: SimonMStewart

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Even the volume serial number can be copied. Try any app like Ghost and you can create an identical machine using the same VSN. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          S 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Strt generating your own ID's 'cause getting them from the hardware is spotty at best. There is no standard that MUST be followed by all vendors for tagging their hardware. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            D Offline
            D Offline
            Dan Neely
            wrote on last edited by
            #5

            Dave Kreskowiak wrote:

            Strt generating your own ID's 'cause getting them from the hardware is spotty at best. There is no standard that MUST be followed by all vendors for tagging their hardware.

            I'm doing a "yes, but..." here. OEM versions of Windows use the moboID to enforce only installing the licence on a single computer (if you mobo has to be replaced you need a new serial, oem versions are only half as expensive though). Presumably this means there's no easy way to change/spoof it, otherwise MS would've elected a different enforcement method.

            D 1 Reply Last reply
            0
            • D Dave Kreskowiak

              Even the volume serial number can be copied. Try any app like Ghost and you can create an identical machine using the same VSN. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              S Offline
              S Offline
              SimonS
              wrote on last edited by
              #6

              Dave Kreskowiak wrote:

              volume serial number can be copied

              Granted, but he was looking for an answer to his question, not criticism of the idea. Regarding your other comment, one of the ways of doing key generation / app licensing is to make sure you can reproduce the key at will to recheck the user-supplier key against the code generated one. If you get fancy and use Guid.New or something similar, you'd have to store that on disk somehow to recheck the validity of the user's app. Cheers, Simon > blog:: brokenkeyboards > my opinion of VS05 :: here > CV :: PDF > skype me! :: SimonMStewart

              1 Reply Last reply
              0
              • D Dan Neely

                Dave Kreskowiak wrote:

                Strt generating your own ID's 'cause getting them from the hardware is spotty at best. There is no standard that MUST be followed by all vendors for tagging their hardware.

                I'm doing a "yes, but..." here. OEM versions of Windows use the moboID to enforce only installing the licence on a single computer (if you mobo has to be replaced you need a new serial, oem versions are only half as expensive though). Presumably this means there's no easy way to change/spoof it, otherwise MS would've elected a different enforcement method.

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Like I said, there is no reliable method of getting an ID off the motherboard, or any other device for that matter. And, I've never had to get a new serial number for an OEM motherboard replacement. If you're talking about Windows XP's activation, there is no mobo ID in use. It gathers information from many different points in the system and registry to create a key. If the hardware changes too much, then the key breaks. But it does allow for limited changes in the system, like a replacement mobo, new hard drive, or changing out the video controller. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups