Click here to Skip to main content
15,907,396 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,
Is there a .NET Framework facility for adding/removing/managing device drivers?
For example,can I build a VB.NET application to list loaded drivers, or drivers attached to a
specific device, then load or unload those drivers as needed?
Do you have any ideas? Thanks.
Posted
Updated 29-Jun-10 17:41pm
v2

You can use Windows Management Instrumentation (WMI) to perform various system related activities, it is quite a complex area, so start searching Google + Microsoft. There used to be an extension for Visual Studio for working with WMI (to make it easier to find the object names to use, but don't know if it is still available (it was from Microsoft, so maybe search their site).

There is an Article on CodeProject on the loading/unloading drivers;
TDriver - Loading Device Drivers[^]
 
Share this answer
 
Comments
shujsj2010 30-Jun-10 3:06am    
Can Windows Device Drivers be written in VB.NET?
DaveAuld 30-Jun-10 3:15am    
My understanding is no, these need to be in C++, check out Microsoft Windows Driver Development site. http://www.microsoft.com/whdc/DevTools/default.mspx
Imports System.IO

Sub GetAllDrives()
        Dim driveArr As DriveInfo() = DriveInfo.GetDrives
        For Each drive As DriveInfo In driveArr
            If drive.IsReady Then
                Console.WriteLine(String.Format("Name:{0} - Drive Type:{1} - Format:{2} - Label:{3} - Total Size:{4}" _
                                                , drive.Name, drive.DriveType, drive.DriveFormat, drive.VolumeLabel, drive.TotalSize))

            End If
        Next
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900