|
-
Dec 21st, 2005, 11:44 AM
#1
Thread Starter
New Member
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.
-
Dec 21st, 2005, 11:47 AM
#2
Thread Starter
New Member
Re: PhysicalMedia problem in web application
PS - Both loops work fine from win forms program
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|