Results 1 to 5 of 5

Thread: [2005] WMI namespace and classes

  1. #1

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    [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.

  2. #2
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651

    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 ...

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    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.

  5. #5

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: [2005] WMI namespace and classes

    Quote 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
  •  



Click Here to Expand Forum to Full Width