通过编程方式重新启动的USB设备在Windows [英] Programatically restart USB device in Windows

查看:217
本文介绍了通过编程方式重新启动的USB设备在Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些软件我开发需要USB设备的presence(我互动作为的SerialPort,用USB转UART桥接)。

Some software I am developing requires the presence of a USB device (which I interact with as a SerialPort, with a USB-to-UART bridge).

有时候,后一计算机正在从休眠重新启动时,该装置没有被检测到,并且我不能再写入,或从该设备通过其串行端口读出。具有读/写访问的设备是必要的。

Sometimes, after a computer is being restarted from hibernation, the device is not being detected, and I can no longer write to, or read from, the device through its serial port. Having read/write access to the device is necessary.

我不能依靠用户采取任何行动(物理或其他方式),所以我需要一种方法以编程方式重新启动设备。

I cannot rely on the user to take any action (physical or otherwise), so I need a way to restart the device programmatically.

我应该如何进场使用.NET Framework重新启动USB设备编程方式在Windows XP / Vista / 7的?

推荐答案

您可以使用的 WDK (Windows驱动程序工具包)。大量的源$ C ​​$ C例子提供,而是奢望一段陡峭的学习曲线。

You could use the WDK (Windows Driver Kit). Lots of source code examples provided, but expect a steep learning curve.

复康是一个程序通过MS出于演示的目的是有时作品和你想要做什么开发。但要知道,这是怪异和野生。总之,源$ C ​​$ C提供,所以如果你喜欢摆弄设备驱动程序,你可以滚你自己的复康code。

Devcon is a program developed by MS for demonstration purposes that sometimes works and does what you want. But be aware that it is weird and wild. Anyway, the source code is provided, so if you like to mess with device drivers, you can roll your own "Devcon" code.

从MS网站:

开发者大会(Devcon.exe的),设备控制台是一个命令行工具,它显示         有关设备的详细信息。使用开发者大会,您可以搜索和         操作命令行的设备。开发者大会启用,禁用,安装,         配置,并删除在本地计算机和显示详细的设备上的         关于本地和远程计算机设备的信息。

DevCon (Devcon.exe), the Device Console, is a command-line tool that displays detailed information about devices. Using DevCon, you can search for and manipulate devices from the command line. DevCon enables, disables, installs, configures, and removes devices on the local computer and displays detailed information about devices on local and remote computers.

心连心!

这篇关于通过编程方式重新启动的USB设备在Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆