473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Enumerating property values within WMI

Hello,

I'm trying to write a function that will display, in a message box, the
enumerated property names and values of the passed in Win32 class name. The
function is as follows:

Function displayClassPropertyNames(ByVal className As String)
Dim mc As New ManagementClass(className)
Dim pdc As PropertyDataCollection = mc.Properties
Dim pd As PropertyData
Dim propertyName As String
Dim propertyValue As String
Dim msg As String
For Each pd In pdc 'repeat through each piece of property data in
the property data collection
propertyName = pd.Name 'grab the name of the current property in
the collection
propertyValue = pd.Value 'grab the value of the current property
in the collection
msg = "Property Name = " & propertyName & vbCrLf & "Property
Value = " & propertyValue
MsgBox(msg)
Next
End Function
When I run this function and pass it Win32 class name like:

displayClassPropertyNames("ManagementObjectCollect ion")

The messagebox displays the property names perfectly but for some reason the
values for every property are empty. I know I must be doing something
incorrectly but I am very new at VB.NET coding so I'm not sure exactly
what's the problem.

Any suggestions or help would be very appreciative.

Best Regards,

devin
Nov 20 '05 #1
0 956

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DraguVaso | last post by:
Hi, I'm having some weird behaviour, and I can't find any solution to this. I made a UserControl (uclCommands) which contains a Toolbar (ToolBar1) with Modifiers = Public. I put this...
4
by: Lyn | last post by:
Hi, This question may seem a bit academic... To learn more about Access VBA, I have been enumerating the properties of various form controls. This was mostly successful and I have learned a lot...
1
by: sonic | last post by:
Hi, Is there a signature that would allow me to set values for such properties as NameValueCollection or StringList within ASPX xml definition ? example: myControl has a Values property of...
4
by: CrispinH | last post by:
I'm building an application generator and within it a user can create a new property (for the class they are building). I'd like then to offer a list of Types - built-in and custom - for this new...
1
by: Morten Snedker | last post by:
I've made myself a class for enumerating folders. But I'm a bit confused how to use it. It looks like this: '--Class begin Imports System.IO Public Class ListFolders Private _folder As...
0
by: wifetalks | last post by:
I'm enumerating the computers in the domain to a listview control on my form, but how do I include the comments. Like what you would see in Windows Explorer when you browse the domain. On our...
0
by: AdamKadmon | last post by:
Hello Group, Below is (mostly)functional code that enumerates certain properties for all of the groups in my Active Directory. My question is contained within comments as well as here: Once I...
2
by: Louis | last post by:
Please help..... I am starting to learn using javascript on DOM. One of the first things I tested was listing all the child nodes from an element. Like -> *html code: <div id="pagetitle">...
14
by: Lane Straatman | last post by:
I would like to write a 'struct'. I have a library that is all but completely inappropriate for this task. So I'm looking for C code that fills in the gaps between: #undef...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.