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
  1. Home
  2. General Programming
  3. C#
  4. hard disk serial no

hard disk serial no

Scheduled Pinned Locked Moved C#
databasehelp
6 Posts 3 Posters 0 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.
  • B Offline
    B Offline
    Bhim Prakash Singh
    wrote on last edited by
    #1

    hi friends i want to retrive hard disk serial no. i use this code 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 but this code does not work properly. this error show Object reference not set to an instance of an object.

    N M 2 Replies Last reply
    0
    • B Bhim Prakash Singh

      hi friends i want to retrive hard disk serial no. i use this code 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 but this code does not work properly. this error show Object reference not set to an instance of an object.

      N Offline
      N Offline
      Nissim Salomon
      wrote on last edited by
      #2

      Hi Try the following link that discribe exacly what you want How to Retrieve the REAL Hard Drive Serial Number[^]

      B 1 Reply Last reply
      0
      • N Nissim Salomon

        Hi Try the following link that discribe exacly what you want How to Retrieve the REAL Hard Drive Serial Number[^]

        B Offline
        B Offline
        Bhim Prakash Singh
        wrote on last edited by
        #3

        hi this code work on normal hard disk. but on sata hard disk this code does not work.

        1 Reply Last reply
        0
        • B Bhim Prakash Singh

          hi friends i want to retrive hard disk serial no. i use this code 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 but this code does not work properly. this error show Object reference not set to an instance of an object.

          M Offline
          M Offline
          MumbleB
          wrote on last edited by
          #4

          Hi. This is a C# forumn. Try the VB forumn for VB help.

          Excellence is doing ordinary things extraordinarily well.

          B 1 Reply Last reply
          0
          • M MumbleB

            Hi. This is a C# forumn. Try the VB forumn for VB help.

            Excellence is doing ordinary things extraordinarily well.

            B Offline
            B Offline
            Bhim Prakash Singh
            wrote on last edited by
            #5

            dear i have solution in C# plz tell me

            M 1 Reply Last reply
            0
            • B Bhim Prakash Singh

              dear i have solution in C# plz tell me

              M Offline
              M Offline
              MumbleB
              wrote on last edited by
              #6

              If you are using VS2008 and .net 3.5 you can use the System.Management namespace. Have a look at this link. Search HDD Serial Number[^]

              Excellence is doing ordinary things extraordinarily well.

              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