添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Code:
Private Function GetHardDriveID(Optional ByVal DriveLetter As String = "C") As String
        Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia")
        For Each wmi_HD As ManagementObject In searcher.Get()
            MessageBox.Show(CStr(wmi_HD("SerialNumber")))
    End Function
But, it gets the serial number of every hard drive in my computer. How can I just get it for the local disk, C? Yes, I know it's because of the For Each, but I don't know what to replace it with. Thanks!
hmmm.. not really lol. hey do you know how to get the hd serial number using the command prompt, like above?
i used:
Code:
wmic:root\cli>diskdrive get serialnumber
But, it gave me a number that looked nothing like the serial in the picture: 3D9GJ156FF1128 I think I got it working. I don't know if it's my actual hard disk serial number, but it gives me a number lol:
I used this:
http://www.microsoft.com/en-us/downl...s.aspx?id=8572 Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.