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. Web Development
  3. ASP.NET
  4. Get SerialNumber Disk Driver

Get SerialNumber Disk Driver

Scheduled Pinned Locked Moved ASP.NET
sysadminhelpquestion
5 Posts 2 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.
  • A Offline
    A Offline
    AnhTin
    wrote on last edited by
    #1

    Hi all I am bulding application web. I have problem with Licenes key I check key by SerialNumber Disk Driver on Server. HardDrive hd = null; ManagementObjectSearcher searcher; ArrayList hdCollection = new ArrayList(); searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive"); foreach (ManagementObject wmi_HD in searcher.Get()) { hd = new HardDrive(); hd.Model = wmi_HD["Model"].ToString(); hd.Type = wmi_HD["InterfaceType"].ToString(); if (wmi_HD["SerialNumber"] == null) hd.SerialNo = "None"; else hd.SerialNo = wmi_HD["SerialNumber"].ToString(); hdCollection.Add(hd); } But have problem when i insert usb, the system get SerialNo of USB. How can i get only SerialNo HDD on Computer.

    C 2 Replies Last reply
    0
    • A AnhTin

      Hi all I am bulding application web. I have problem with Licenes key I check key by SerialNumber Disk Driver on Server. HardDrive hd = null; ManagementObjectSearcher searcher; ArrayList hdCollection = new ArrayList(); searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive"); foreach (ManagementObject wmi_HD in searcher.Get()) { hd = new HardDrive(); hd.Model = wmi_HD["Model"].ToString(); hd.Type = wmi_HD["InterfaceType"].ToString(); if (wmi_HD["SerialNumber"] == null) hd.SerialNo = "None"; else hd.SerialNo = wmi_HD["SerialNumber"].ToString(); hdCollection.Add(hd); } But have problem when i insert usb, the system get SerialNo of USB. How can i get only SerialNo HDD on Computer.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can check if the drive letter is a fixed drive, there's a way to get an array of DriveInfo objects that will tell you that.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      1 Reply Last reply
      0
      • A AnhTin

        Hi all I am bulding application web. I have problem with Licenes key I check key by SerialNumber Disk Driver on Server. HardDrive hd = null; ManagementObjectSearcher searcher; ArrayList hdCollection = new ArrayList(); searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive"); foreach (ManagementObject wmi_HD in searcher.Get()) { hd = new HardDrive(); hd.Model = wmi_HD["Model"].ToString(); hd.Type = wmi_HD["InterfaceType"].ToString(); if (wmi_HD["SerialNumber"] == null) hd.SerialNo = "None"; else hd.SerialNo = wmi_HD["SerialNumber"].ToString(); hdCollection.Add(hd); } But have problem when i insert usb, the system get SerialNo of USB. How can i get only SerialNo HDD on Computer.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Just to add, this s a C# question that has nothing to do with ASP.NET, why did you post it here ?

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        A 1 Reply Last reply
        0
        • C Christian Graus

          Just to add, this s a C# question that has nothing to do with ASP.NET, why did you post it here ?

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          A Offline
          A Offline
          AnhTin
          wrote on last edited by
          #4

          Thanks Reply my app is asp.net check LicenesKey With DriveInfo i dont get SerialNumber HDD disk !!!!

          C 1 Reply Last reply
          0
          • A AnhTin

            Thanks Reply my app is asp.net check LicenesKey With DriveInfo i dont get SerialNumber HDD disk !!!!

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            OK, well, that's reasonable. It's still not an ASP.NET question, tho. No, with DriveInfo you can check if the drive you're looking at is removable. Does your other code not give you the drive letter you're looking at so you can match the two ?

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            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