Enumerating hardware devices?

SephirothSephiroth Fayetteville, NC, USA
How does one go about this task in VB.NET? I am working on two projects at this point and need to figure out what devices of a set type are installed in the system in each program. One needs to discover all modems and network cards, and the other needs to find all CD/DVD drives and get their mounted letter, such as D:. How would I do this? I know there are methods to do so in C++, but these two applications are Win32/Win64 only, so I am using VB.NET fopr fast development.

-[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/green][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h[/red][/b][/italic]

Comments

  • : How does one go about this task in VB.NET? I am working on two
    : projects at this point and need to figure out what devices of a set
    : type are installed in the system in each program. One needs to
    : discover all modems and network cards, and the other needs to find
    : all CD/DVD drives and get their mounted letter, such as D:. How
    : would I do this? I know there are methods to do so in C++, but these
    : two applications are Win32/Win64 only, so I am using VB.NET fopr
    : fast development.
    : [link=null][/link]
    : -[italic][b][red]S[/red][purple]e[/purple][blue]p[/blue][green]h[/gre
    : en][red]i[/red][purple]r[/purple][blue]o[/blue][green]t[/green][red]h
    : [/red][/b][/italic]

    After much searching, I have deduced that you will need to use WMI for this. It uses a variation of SQL: WQL
    Here are the MSDN links I came accros:
    [link=http://msdn2.microsoft.com/en-us/library/ms186146.aspx]WMI Queries[/link]
    Then for the classes you can use in the WQL statements look at [link=http://msdn2.microsoft.com/en-us/library/aa389273.aspx]Computer System Hardware Classes[/link].

    EDIT: Another (useful?) link: [link=http://msdn2.microsoft.com/en-us/library/ms186146.aspx]WMI .NET implementation[/link]

    Accessing the the WMI information goes through the System.Management namespace.

    This could get really complicated - but I think I gave you a very nice first step: you now atleast know WHAT to look for - I spent around 45 minutes browsing the .NET framework classes and entering fruitless search queries in the .NET documentation :)

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • Sounds to me like what you're trying to do is capute device manager information for any given pc. I'm working on a project in VB.Net that does this. It uses APIs to get the device classes, devices and related information for the device. I use a treeview and listviews to display the information. Once I have the information diplayed properly my plan is to write it to a series of tables using the computer name as a key. This will allow me to capture baseline configuration information for one or more computers, store it, and redisplay it at will. I'm also considering adding query capabilities to the tool. For now I have the treeview populated with device classes and devices and I have some of the device information being displayed. My device classes are not being displayed in the same order as device manager. Still trying to figure that one out, but I'm on my way.

    Is this what you're looking for?
  • Sounds to me like what you're trying to do is capute device manager information for any given pc. I'm working on a project in VB.Net that does this. It uses APIs to get the device classes, devices and related information for the device. I use a treeview and listviews to display the information. Once I have the information diplayed properly my plan is to write it to a series of tables using the computer name as a key. This will allow me to capture baseline configuration information for one or more computers, store it, and redisplay it at will. I'm also considering adding query capabilities to the tool. For now I have the treeview populated with device classes and devices and I have some of the device information being displayed. My device classes are not being displayed in the same order as device manager. Still trying to figure that one out, but I'm on my way.

    Is this what you're looking for?
  • Sounds to me like what you're trying to do is capute device manager information for any given pc. I'm working on a project in VB.Net that does this. It uses APIs to get the device classes, devices and related information for the device. I use a treeview and listviews to display the information. Once I have the information diplayed properly my plan is to write it to a series of tables using the computer name as a key. This will allow me to capture baseline configuration information for one or more computers, store it, and redisplay it at will. I'm also considering adding query capabilities to the tool. For now I have the treeview populated with device classes and devices and I have some of the device information being displayed. My device classes are not being displayed in the same order as device manager. Still trying to figure that one out, but I'm on my way.

    Is this what you're looking for?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories