Results 1 to 2 of 2

Thread: PhysicalMedia problem in web application

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    4

    PhysicalMedia problem in web application

    Not sure where to put this --- I'll start here.

    Hoping to obtain HD serial number in a web application.. I'm using the following code in global.asax.vb :

    Dim searcher As New Management.ManagementObjectSearcher("select * from Win32_PhysicalMedia")
    Dim wmi_HD As Management.ManagementObject

    For Each wmi_HD In searcher.Get()
    Response.Write(wmi_HD("SerialNumber"))
    Next

    searcher = New System.Management.ManagementObjectSearcher("select * from Win32_DiskDrive")
    For Each wmi_HD In searcher.Get()
    Response.Write(wmi_HD("Model"))
    Next

    The 2nd loop works fine and iterates through 2 management objects (I have 2 harddrives) - but the 1st loop is never entered. Apparently no objects were returned by the "PhysicalMedia" query. My question is "Why?" Every answer that occurs to me would also seem to necessitate the failure of the 2nd loop as well. Any ideas?
    Last edited by jaybousquet; Dec 21st, 2005 at 11:54 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width