How to enable & disable USB ports from .NET applications?
-
Dear All, i have developed a desktop based application using C#.NET, which require access to some USB based devices. I have to use this application on target PCs in which the USB port is disabled by the system administrator. From the application, i wants to enable & disable the USB drives programatically, so that no other application can use the USB ports, as per configured by the system administrator. ie, enable the USB port before the application require access to the USB port it & disable it after the use. I need to achieve the same when the application is running in a login, who doesn't have administrative rights. Is it possible to achieve the same using .NET framework? Do any one knows how to implement the same. If so, please inform me. Best Regards, Abhilash Chandran
-
Dear All, i have developed a desktop based application using C#.NET, which require access to some USB based devices. I have to use this application on target PCs in which the USB port is disabled by the system administrator. From the application, i wants to enable & disable the USB drives programatically, so that no other application can use the USB ports, as per configured by the system administrator. ie, enable the USB port before the application require access to the USB port it & disable it after the use. I need to achieve the same when the application is running in a login, who doesn't have administrative rights. Is it possible to achieve the same using .NET framework? Do any one knows how to implement the same. If so, please inform me. Best Regards, Abhilash Chandran
Using the standard drivers for USB, you can't do what you want, no matter what language you use. Hardware is shared system-wide and is completely abstracted from your application, giving you no control over access to the USB ports. You would have to write your own USB drivers in order to support this.
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007