|
-
Aug 21st, 2006, 04:35 AM
#1
Thread Starter
Frenzied Member
[2005] WMI namespace and classes
Hi guys, how do I get the namespace and classes w/ the specific property.
The user input a certain property then the application will query on what namespace and class it is under.
i.e IPaddress it's under root/cimv2 namespace and win32_networkadapterconfiguration class.
thanks in advance guys.
-
Aug 21st, 2006, 08:48 AM
#2
Fanatic Member
Re: [2005] WMI namespace and classes
The System.Management is not imported by default into the project, right click on Reference to display the "Add Reference" form, select "System.Management" from the .NET tab.
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Aug 21st, 2006, 09:02 AM
#3
Re: [2005] WMI namespace and classes
If I'm reading this correctly you want to get a list of all classes that have a property with a name specifed by the user. That's like saying you want a list of all the people with a particular shoe size. How woul;d you do that but measure the foot of every person? The property doesn't specify the class. The class specifies the property, so you will just have to check every class to see if it has a property with the specified name.
-
Aug 21st, 2006, 10:16 AM
#4
Re: [2005] WMI namespace and classes
I've done it, using reflection, but it was really just more of a pain. The MySystemSpy program in my sig is what it was for, queries all of the WMI classes that the user chooses by just clicking on em. Check out my WMI codebank for examples and a DLL that I created that could come in handy, it would be easier to just do select cases for the WMI classes you want, because each class has specific sets of properties, and each sets of properties are different for each class, with some being arrays, etc.
The example in my sig has a way to pull up the general properties, just be a matter of passing in the string you want that has the Win32 class you wish to use. Problem with it is that some properties have numerical values that have no meaning unless you look up the values in the documentation, which by using the DLL might remedy a lot of that...
Last edited by gigemboy; Aug 21st, 2006 at 10:25 AM.
-
Aug 21st, 2006, 06:46 PM
#5
Thread Starter
Frenzied Member
Re: [2005] WMI namespace and classes
 Originally Posted by jmcilhinney
If I'm reading this correctly you want to get a list of all classes that have a property with a name specifed by the user. That's like saying you want a list of all the people with a particular shoe size. How woul;d you do that but measure the foot of every person? The property doesn't specify the class. The class specifies the property, so you will just have to check every class to see if it has a property with the specified name.
Yeah, quite a big problem for me considering there are thousand of classes in each namespace.
Actually our scripters here use the dll's we created about wmi and they're just going to input the property and in our dll's it managed to get the value of it. Before you could get the value of a property you must know on what namespace and classes it's under then get the value. Our dll's is doing good but it's not complete we still have to add some property based on the demand of the scripters. So I come up of an child-to-parent idea, meaning input value is child then know who's the parent.
gigemboy: I try to check it out.
btw thanks for all the reply guys.
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
|