VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Enumerating hardware devices? Posted by Sephiroth on 13 Sept 2007 at 5:59 PM
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.

-Sephiroth
Report
Re: Enumerating hardware devices? Posted by BitByBit_Thor on 16 Sept 2007 at 2:57 PM
: 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.
:
: -Seph[/gre
: en]iroth
:


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:
WMI Queries
Then for the classes you can use in the WQL statements look at Computer System Hardware Classes.

EDIT: Another (useful?) link: WMI .NET implementation

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
Report
Re: Enumerating hardware devices? Posted by VSCurtis on 18 Feb 2012 at 9:55 PM
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?
Report
Re: Enumerating hardware devices? Posted by VSCurtis on 18 Feb 2012 at 9:57 PM
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?
Report
Re: Enumerating hardware devices? Posted by VSCurtis on 18 Feb 2012 at 9:58 PM
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?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.